Re: Help : I cannot poly_fit to 9 degree!!! [message #11579] |
Thu, 30 April 1998 00:00  |
medimage
Messages: 3 Registered: April 1998
|
Junior Member |
|
|
4P:
There should be no relation to the system memory or operating system.
Otherwise it will be a hell.
Actually the problem you mentioned is a bug of IDL, IMHO, and has not
been corrected in IDL5.0. The fiting procedures in IDL stops when it
meets the following calculations:
0*x=1
That means you didn't have that problem when fit until to 8th degree,
but came out when you went to 9 degreee and thereafter.
Think about it easier way, you want to fit
x=[0,0] and y=[0,2]
IDL can only fit to 0th degree, and gives y=1
If you want to fit to 1 degree, IDL crashes!
Good luck
BTW, 4P, I haven't seen you often in ACT for a while. Are you going to
graduate soon from Chicago?
In article <6i9jat$jsa$3@gwdu19.gwdg.de>,
pit@uni-sw.gwdg.de wrote:
>
> In article <35483EFD.4747@midway.uchicago.edu>,
> Pao-hung Lin <plin21@midway.uchicago.edu> writes:
>> Guys, I need help in my research.
>>
>> I need to fit a x-y curve(200 points each)
>> in polymoninal to 9 degree or even 10 degree.
>> However, my IDL 4.01 on win 95 only allow me to fit
>> to 8 degree or less(just one degree less , isn't that great?)
>> 9 degree or higher will cause the program to crash and jump out.
>
> Is this on *every* fit you try with degree>8, or just with your
> (typical?) data? I just tried a poly_fit(x,y,12) here (IDL 4.01 on
> Linux P133/64MB) and it does work.
>
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
|
|
|
Re: Help : I cannot poly_fit to 9 degree!!! [message #11726 is a reply to message #11579] |
Fri, 01 May 1998 00:00  |
Pao-hung Lin
Messages: 8 Registered: April 1998
|
Junior Member |
|
|
medimage@hotmail.com wrote:
> There should be no relation to the system memory or operating system.
> Otherwise it will be a hell.
> In article <6i9jat$jsa$3@gwdu19.gwdg.de>,
> pit@uni-sw.gwdg.de wrote:
>> ause the program to crash and jump out.
Thank you all guys, your information have been very helpful.
I found out eventually (after 24 hr of struggling) that the problem is
the sigma value that I wanted. The fit seems O.K. as long as I don't
ask for the sigma or try to calculate it in single precision
The way to get around it is by calculating the sigma yourself from
yfit and y, and set the sigma parameter to DOUBLE-PRECISION before you
calculate
I think the reason is that the floting-point of the sigma or some
parameter the poly_fit program use to calculate the sigma turn to
underflow
and cause the trouble in poly_fit when I try to calculate 9 degree
fitting.
So by the following line:
--------------------------
Sigmaa=dblarr(lengthofxy)
.........
result=poly_fit(x,y,9,yfit) ; definately don't ask for the sigma
here!!!
sigmaa=sqrt(total((y-yfit)^2)/(lengthofxy-1))
------------------------
We can get around the underflow problem and still get the sigma we
need for 9 degree or higher
> BTW, 4P, I haven't seen you often in ACT for a while. Are you going to
> graduate soon from Chicago?
I finished my instrument about 1.5 month ago , it worked like charm.
So I can get my data in a couple weeks and start writing my paper.
At this speed, I wish I can get my PH.D. degree earily next year:)
As for ACT, I think I have done almost all I can over there.
After all, it is better to have a PH.D. degree to serve your country
efficienty :)
|
|
|