🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: uk.education.maths
Article #21

Re: 5 Dimensional Interpolation algorithm

#21
From: Stan
Date: Wed, 20 Oct 1999 00:00
121 lines
5023 bytes
(repost, some groups were unresolved on that server)

--
Regards,
   Stan (stan@throat.sla.sh)
* A little nonsense now and then is cherished by the wisest men.

Stan wrote in message ...
>On Wed, 20 Oct 1999, Ramesh S Guzar wrote:
>
>>Hi,
>>
>>I have a Parameter "Z" which depends on 5 independent variables
>>l, m, n , o and p.
>>A1, A2 ......An are the values of Z for (l1,m1,n1,o1,p1) .....
>>to (ln,mn,nn,on,pn) co-ordinates.
>>
>>Is there any method to interpolate between these points ? Can we
>>have an equation for "Z" Interms of the exisiting A1...An values
>>and the independent variables so that we can get the Value of
>>Z for any set of l,m,n,o,p ? What should be the minimum number of
>>values (A1....An) that will be required , and what will be the
>>hit on accuracy ?
>
>Let us first consider interpolation for data set (a_i,b_i).
>Let b be the column vector of b_i and A be the system describing the
>interpolation.
>What I mean by 'describing' is a bit tricky to define, so I'll give an
>example instead:
> for linear interpolation of data set (a_i,b_i) let b = [ b1 b2 ... bn ]',
>where ' indicates traspose, and A = [ [1,a1],[1,a2],...,[1,an] ], and r =
>[ r0 r1 ]'. Then you will get a system of equations b_i = r0 + r1 a_i if
>you multiply it out.
>
>Anyway...
>
>b =~ Ar, for some unknown vector r.
>The objective is minimizing ||Ar-b|| (i.e. the magnitude of the error
>vector). Let W be the span of A (column vectors). Pictorially, it can seen
>that to minimize ||Ar-b||, you need to minimize the projection of vector b
>onto the W hyperplane.
>
>THe projection of b onto W is given by b_W = A inv(A'A) A' b
>(justification of this formula is given at the end of this post)
>
>Thus r = inv(A'A) A' b, where inv(.) indicates inverse.
>
>---
>Next step: polynomial versus linear interpolation of data set (a_i,b_i) of
>size m (i.e. you have m data points).
>For nth degree polynomial interpolation, you have
>b_i = r0 + r1 x + r2 x^2 + ... + r_n x^n
>
>This makes the matrix A
>A = [ [ 1 a1 a1^2 a1^3 ... a1^n ]
>      [ 1 a2 a2^2 a2^3 ... a2^n ]
>          ...................
>      [ 1 a_m a_m^2 ... a_m^n ] ].
>and
>r = [ r0 r1 ... r_n ]'
>
>The b matrix is still just a column vector of all of your b_i values.
>
>---
>Example: interpolating b_i = f(x_i,y_i)
>
>let's say you have some b_i associated with (x_i,y_i), and your data set
>is of size m.
>
> Pick an interpolating function of two variables.
>For my example, I'll use 2nd degree
> f(x,y) = r0 + r1 x + r2 y + r3 xy + r4 x^2 + r5 y^2
>
>Then the matrix A becomes
>A = [ [ 1 x1 y1 x1y1 x1^2 y1^2 ]
>      [ 1 x2 y2 x2y2 x2^2 y2^2 ]
>          ...............
>      [ 1 x_m y_m x_my_m x_m^2 y_m^2 ] ]
>r = [ r0 r1 r2 r3 r4 r5 ]'
>b = [ b1 b2 b3 ... b_m ]'
>
>The coefficient of the polynomial f(x,y) are r_i and the column vector r
>containing r_i is given by
> r = inv(A'A) A' b
>
>You can do quite similar things for any dimension and picking some n as
>the degree of you polynomial - and you are not limited to polynomial
>funtions, one can just as easily have, say f(x,y) = r0 tan x + r1 tan y
>or something like that.
>
>
>The promised justification of b_W = A inv(A'A) A' b :
>----
>Let W = span(a1,a2,...,ak) where each a_k is the kth column vector of A.
>b lies in R^n and W is a subspace of R^n
> b = b_W + (b - b_W)
>All vectors in W can be written as v = Ax, where x = [ x1 x2 ... xk ]'.
>Since b_W is in W, there must be some r = [ r1 r2 ... rk ] such that
> b_W = Ar
>Now since (b-Ar) is normal to every vector in W, the dot product must be
>0 of (b-Ar) and Ax must be zero, i.e.
> (Ax)'(b-Ar) = x'(A'b - A'Ar) = [0]
>Therefore (A'b - A'Ar) = [0].
>Since A'A is invertible (kxk matrix of same rank as A), we can do,
>r = inv(A'A) A' b
>
>And since b_W = Ar,
>
>b_W = A inv(A'A) A' b
>
>
>----
>NOTE: I'd love if someone generalized B-splines to ANY dimension. I don't
>think I have the brainpower nor the experience to do it myself.
>That would kik @$$.
>
>--
>Regards,
>   Stan (stan@throat.sla.sh)
>* Big Brother knows you're reading this.
>
Technical Details
Message-ID: <380e04cf@defiant.btitelecom.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <380D9924.F07C58BB@india.ti.com> <Pine.OSF.3.96.991020101038.2685A-100000@email.uah.edu>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f458d,aac74f96f81d5f31
X-Google-Attributes: gidf458d,public
X-Google-Thread: 1130d6,aac74f96f81d5f31
X-Google-Attributes: gid1130d6,public
X-Google-Thread: 10d67e,aac74f96f81d5f31
X-Google-Attributes: gid10d67e,public
X-Google-Thread: f5482,aac74f96f81d5f31
X-Google-Attributes: gidf5482,public
From: "Stan" <lioubos@email.uah.edu>
Subject: Re: 5 Dimensional Interpolation algorithm
Date: 1999/10/20
Message-ID: <380e04cf@defiant.btitelecom.net>
X-Deja-AN: 538512163
References: <380D9924.F07C58BB@india.ti.com> <Pine.OSF.3.96.991020101038.2685A-100000@email.uah.edu>
X-Trace: 20 Oct 1999 14:07:11 -0500, 1cust59.tnt1.huntsville.al.da.uu.net
Newsgroups: uk.education.maths,aus.mathematics,alt.math.recreational,alt.algebra.help
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3