comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: multi-dimensional SVDFIT
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: multi-dimensional SVDFIT [message #25579] Tue, 03 July 2001 14:17 Go to previous message
R.G.S. is currently offline  R.G.S.
Messages: 46
Registered: September 2000
Member
Ingo Wardinski <ingo@gfz-potsdam.de> wrote in message
news:ynlelryc66q.fsf@mt35.gfz-potsdam.de...
> Hi,
> does anyone know, if it is possible to make a multi-dimensional SDVFIT
> to a certain dataset? I'm looking for a SDVFIT of y=f(x1,x2), but
> AFAIK the standard idl SDVFIT routine works only for 1-d.
> thanks in advance
> ingo
> --
> ingo wardinski ingo@gfz-potsdam.de
> GeoForschungsZentrum Potsdam, Telegrafenberg F456, 14473 Potsdam
>
> "Ich war ganz allein in der Maschine und habe dem Piloten gesagt..."
> (Helmut Kohl in "Am Ende des Jahrhunderts")



Hello,
the SVD solution to a least squares fit (Ax=b) to higher dimensions is
trivial.
Merely add on the other dimensions as columns of A, since there is no
difference
in principal between "x^2" and "xy", since to the SVD, the matrix A is
merely a collection
of numbers.

Cheers,
bob stockwell
stocwkell at co-ra dot com



For instance, here is a smallpiece of code that will compute a fit to
f(x,y,z) = a0+a1*x+a2*y+a3*z+a4x*y+a5x*z+a6y*z+a7= x^2+a8y^2+a9z^2

(i.e. 10 parameters second order term polynomial in 3D)



; Here zon = data(x,y,z)
m = 10 ; number of terms in equation
n = n_elements(zon) ; n = number of data points


; create matrix colum by colum
a = dblarr(m,n)
a(0,*) = 1
a(1,*) = x
a(2,*) = y
a(3,*) = z
a(4,*) = x*y
a(5,*) = x*z
a(6,*) = y*z
a(7,*) = x^2
a(8,*) = y^2
a(9,*) = z^2




; Decompose A:
tic = systime(1)
SVDC, A, W, U, V,/double
toc = systime(1)

; Compute the solution and print the result:
result1 = SVSOL(U, W, V, zon,/double)
toc2 = systime(1)
print,result1
[Message index]
 
Read Message
Read Message
Previous Topic: Re: IDLWAVE 4.9: "Cannot open load file: idlw-shell"
Next Topic: Allan Variance?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:43:41 PDT 2025

Total time taken to generate the page: 0.00469 seconds