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

Home » Public Forums » archive » Re: 2D-fit
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
Re: 2D-fit [message #38277] Tue, 02 March 2004 09:36 Go to next message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
Esa Riihonen <esa@riihonen.st.net> writes:

> Hi all!
>
> I seek advice on fitting a following function with 2-free variables mu and
> phi (Below '.' indicates multiplication and '^2' power of 2 ):
>
> F(mu,phi) = a0 + a1.mu + a2.mu^2 + (a3.mu + a4.mu^2).cos(phi-phi0),
>
> phi0 is a constant and ai are the fitting parameters.
>
> Measurement set consists of 240 values (10 values for mu and 24 for phi,
> this in effect a polar coordinate grid with 24 'sectors' and 10 'rings').

Greetings, in addition to Paul's reply, I would like to mention that
my FAQ contains discussion of fitting functions of more than one
variable. And, if you have an even spaced 2D grid, then you can
likely use MPFIT2DFUN.

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
Re: 2D-fit [message #38283 is a reply to message #38277] Tue, 02 March 2004 08:58 Go to previous messageGo to next message
Esa Riihonen is currently offline  Esa Riihonen
Messages: 6
Registered: July 2003
Junior Member
On Tue, 02 Mar 2004 10:53:47 -0500, Paul van Delst wrote:

[snip]

> *THE* best way would be to download Craig Markwardt's MPFIT library and
> use that. Not only is it more robust than equivalent IDL procedures,
> there's a *lot* more functionality that will allow you to fit stuff oh so
> much faster.
>
> Seriously, go to
>
> http://cow.physics.wisc.edu/~craigm/idl/idl.html
>
> and grab his MPFIT library.
>
> paulv


Did that, looks just what I needed.

Thanks,


Esa


--
Esa Riihonen - esa@riihonen.st.net (Remove spam trap = '.st')

The CT Creed: "There is no Game but Traveller,
and High Guard is its Product" Steve Hudson
Re: 2D-fit [message #38284 is a reply to message #38283] Tue, 02 March 2004 07:53 Go to previous messageGo to next message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Esa Riihonen wrote:
>
> Hi all!
>
> I seek advice on fitting a following function with 2-free variables mu and
> phi (Below '.' indicates multiplication and '^2' power of 2 ):
>
> F(mu,phi) = a0 + a1.mu + a2.mu^2 + (a3.mu + a4.mu^2).cos(phi-phi0),
>
> phi0 is a constant and ai are the fitting parameters.
>
> Measurement set consists of 240 values (10 values for mu and 24 for phi,
> this in effect a polar coordinate grid with 24 'sectors' and 10 'rings').
>
> So the question what is the best way of doing this in IDL?

*THE* best way would be to download Craig Markwardt's MPFIT library and use that. Not only
is it more robust than equivalent IDL procedures, there's a *lot* more functionality that
will allow you to fit stuff oh so much faster.

Seriously, go to

http://cow.physics.wisc.edu/~craigm/idl/idl.html

and grab his MPFIT library.

paulv

--
Paul van Delst
CIMSS @ NOAA/NCEP/EMC
Re: 2D-fit [message #38354 is a reply to message #38277] Wed, 03 March 2004 00:53 Go to previous message
Esa Riihonen is currently offline  Esa Riihonen
Messages: 6
Registered: July 2003
Junior Member
On Tue, 02 Mar 2004 11:36:18 -0600, Craig Markwardt wrote:

[snip]

> Greetings, in addition to Paul's reply, I would like to mention that my
> FAQ contains discussion of fitting functions of more than one variable.
> And, if you have an even spaced 2D grid, then you can likely use
> MPFIT2DFUN.
>
> Craig

Hi!

Thanks for the FAQ tip. And yes, MPFIT2DFUN, looks just right for the job.

Furthermore, I used IDL's own CURVEFIT for an earlier (1-d) fit. I guess I
could use it in principle also here, but was seeking for a more intuitive
(for me) approach. However I was puzzled with the error estimates I got
for the parameters (they just don't make sense). If I understood what I
have read from the documentations thus far, MPFIT seems to addresses this
problem also.

Cheers,

Esa

--
Esa Riihonen - esa@riihonen.st.net (Remove spam trap = '.st')

The CT Creed: "There is no Game but Traveller,
and High Guard is its Product" Steve Hudson
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Statistic codes: Significance level
Next Topic: Re: BYTSCL and NAN keyword

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

Current Time: Wed Oct 08 13:46:23 PDT 2025

Total time taken to generate the page: 0.00441 seconds