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

Home » Public Forums » archive » MPFITFUN multiple variable
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
MPFITFUN multiple variable [message #94691] Wed, 23 August 2017 19:10 Go to next message
bjy512 is currently offline  bjy512
Messages: 2
Registered: August 2017
Junior Member
I am working with the modis data with pm10 concentration and other lots of meteorological varibales and to get a regression equations, i am using mpfitfun function as i could make my own equations.

However, there are big problems in the results. (1) too big CHI-SQUARE (2) too small correlation coefficient and (3) I DON'T KNOW WHAT TO DOOOOOOO!!!!

so if you know how to fix this, please help me... i am literally fixing this over weeks......

belows are my code

<result>
Iter 12 CHI-SQUARE = 55324548. DOF = 28008
P(0) = 38.9913
P(1) = 0.379677
P(2) = -0.738418
P(3) = -0.325880
P(4) = -0.00822390
P(5) = 274.202
38.991277 0.37967665 -0.73841789 -0.32587978 -0.0082238981
274.20198
% Compiled module: CORRELATE.
0.38668333

104 jacobian=dblarr(5,number)
105 jacobian=[transpose(aot),transpose(ww),transpose(temp1),tran spose(rr),transpose(hpbla)]
106
107
108
109
110
111 p=[38.44,0.25,-0.7,-0.33,0.,300]
112 weights=replicate(0.5,5,number)
113 err=replicate(0,number)
114
115 weights(0,*)=0.01
116 weights(1,*)=0.5
117 weights(2,*)=0.01
118 weights(3,*)=0.01
119 weights(4,*)=0.01
120
121 s={x1:0.0d,x2:0.0d,x3:0.0d,x4:0.0d,x5:0.0d}
122 s=replicate(s,number)
123 s.x1=aot
124 s.x2=ww
125 s.x3=temp1
126 s.x4=rr
127 s.x5=hpbla
128
129 myfunc='p[5] + p[0]*x[0,*] + p[1]*x[1,*]+p[2]*x[2,*]+p[3]*x[3,*]+p[4]*x[4,*]'
130 result=mpfitexpr(myfunc,jacobian,pm,p,err=err,weight=weights )
131 print,result
132
133 est_pm=dblarr(number)
134
135 for i=0, number-1 do begin
136 est_pm(i)=result(5)+result(0)*jacobian[0,i]+result(1)*jacobi an[1,i]+result(2)*jacobian[2,i]+ result(3)*jacobian[3,i]+result(4)*jacobian[4,i]
137 endfor
Re: MPFITFUN multiple variable [message #94692 is a reply to message #94691] Thu, 24 August 2017 02:45 Go to previous messageGo to next message
Markus Schmassmann is currently offline  Markus Schmassmann
Messages: 129
Registered: April 2016
Senior Member
On 08/24/2017 04:10 AM, Juyeon Bae wrote:
> 130 result=mpfitexpr(myfunc,jacobian,pm,p,err=err,weight=weights )
might it be your syntax is wrong?

extract form mpfitexpr.pro:
> ; parms = MPFITEXPR(MYFUNCT, XVAL, YVAL, ERR, start_parms, ...)
> ; KEYWORD PARAMETERS:
> ; WEIGHTS - Array of weights to be used in calculating the
> ; chi-squared value. If WEIGHTS is specified then the ERR
> ; parameter is ignored. [...]
Re: MPFITFUN multiple variable [message #94696 is a reply to message #94691] Fri, 25 August 2017 07:23 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Wednesday, August 23, 2017 at 10:10:36 PM UTC-4, Juyeon Bae wrote:
> However, there are big problems in the results. (1) too big CHI-SQUARE (2) too small correlation coefficient and (3) I DON'T KNOW WHAT TO DOOOOOOO!!!!

As Markus points hints at... "Too big chi-square" means either that the fit is of poor quality; OR the weights are not assigned correctly. Both of those questions are scientific questions you have to ask yourself; we can't really help you.

If the fit quality looks really good, then that means you are over-weighting your data. If the fit quality looks bad, then you need to develop a better model of the data.

Craig
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: MPFITFUN .TIED
Next Topic: IDL Python Bridge

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

Current Time: Wed Oct 08 05:16:03 PDT 2025

Total time taken to generate the page: 0.00582 seconds