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

Home » Public Forums » archive » HELP NEEDED! to fit a linear equation containing 2 independant variables
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
HELP NEEDED! to fit a linear equation containing 2 independant variables [message #48943] Thu, 08 June 2006 10:17 Go to next message
antoine.dlc is currently offline  antoine.dlc
Messages: 1
Registered: June 2006
Junior Member
Dear fellow IDL programmers,

I'm trying to fit the parameters of a linear equation of type:

z = a*x + b*y + c

where a, b,c are constant parameters and x,y are two independant
variables.

In the past, I used the procedures LMFIT, LINFIT, CURVEFIT to fit
equations but these only accept 1 independant variable.

Can someone tell me if a procedure exists to fit the parameters of a
linear equation made of 2 independant variables???

If not, is it possible to give LMFIT, LINFIT, CURVEFIT...etc. 2
independant variables instead of only 1?


Thanks a lot !!!
Tony
Re: HELP NEEDED! to fit a linear equation containing 2 independant variables [message #48996 is a reply to message #48943] Sun, 11 June 2006 00:14 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
antoine.dlc@gmail.com writes:
> Dear fellow IDL programmers,
>
> I'm trying to fit the parameters of a linear equation of type:
>
> z = a*x + b*y + c
>
> where a, b,c are constant parameters and x,y are two independant
> variables.
>
> In the past, I used the procedures LMFIT, LINFIT, CURVEFIT to fit
> equations but these only accept 1 independant variable.
>
> Can someone tell me if a procedure exists to fit the parameters of a
> linear equation made of 2 independant variables???
>
> If not, is it possible to give LMFIT, LINFIT, CURVEFIT...etc. 2
> independant variables instead of only 1?

Actually LMFIT and CURVEFIT *can* accept multiple variables. If you
read the documentation,

; X: A row vector of independent variables. This routine does
; not manipulate or use values in X, it simply passes X
; to the user-written function.

you can define any "X" vector that you wish as long as it is a single
IDL variable. It could be a structure containing X and Y, or a
concatenated vector of [X, Y] values. Either way, it is up to your
model function to retreive the proper X and Y values from the combined
variable.

Happy fitting,
Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
Re: HELP NEEDED! to fit a linear equation containing 2 independant variables [message #49040 is a reply to message #48943] Thu, 08 June 2006 13:10 Go to previous message
Brian Larsen is currently offline  Brian Larsen
Messages: 270
Registered: June 2006
Senior Member
Tony,

this is exactly what the regress function in idl does. Have a look at
its help page.

Cheers,

Brian

antoine.dlc@gmail.com wrote:
> Dear fellow IDL programmers,
>
> I'm trying to fit the parameters of a linear equation of type:
>
> z = a*x + b*y + c
>
> where a, b,c are constant parameters and x,y are two independant
> variables.
>
> In the past, I used the procedures LMFIT, LINFIT, CURVEFIT to fit
> equations but these only accept 1 independant variable.
>
> Can someone tell me if a procedure exists to fit the parameters of a
> linear equation made of 2 independant variables???
>
> If not, is it possible to give LMFIT, LINFIT, CURVEFIT...etc. 2
> independant variables instead of only 1?
>
>
> Thanks a lot !!!
> Tony
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Factory pressed dvd movies, ps2, psp, xbox backups for sale !!!
Next Topic: how to save image in full size

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

Current Time: Wed Oct 08 15:57:29 PDT 2025

Total time taken to generate the page: 0.00590 seconds