Thread View: uk.education.maths
2 messages
2 total messages
Started by Ramesh S Guzar
Wed, 20 Oct 1999 00:00
5 Dimensional Interpolation algorithm
Author: Ramesh S Guzar
Date: Wed, 20 Oct 1999 00:00
Date: Wed, 20 Oct 1999 00:00
38 lines
2018 bytes
2018 bytes
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 ?
Pictorially, the above looks like,
^ Z
| A2 . . . . . . An
| A1 . . . . . . . . .. . A3
| A32 A29 . . . .
|
n | m A5 A6
\ | /
\ | / A7......A8
\|/
*-------------------------------->l
/ \
/ \
/ \
o p
Thanks for your time,
Thanks and best regards,
Ramesh
Re: 5 Dimensional Interpolation algorithm
Author: Stan
Date: Wed, 20 Oct 1999 00:00
Date: Wed, 20 Oct 1999 00:00
121 lines
5023 bytes
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. >
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads