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 :)
|
|
|