On 8/16/2011 7:58 PM, Gregory Petropoulos wrote:
I am fairly new to PDL and I have gotten the fitpoly1d routine working (PDL::Fit::Polynomial). Unfortunately I have not found any documentation on what the output is. I am calling the function as follows: ($yfit, $coeffs)=fitpoly1d $x, $y, 3 The goal is to fit some data to a quadratic. The output I get looks like: $yfit=[# # # #] $coeffs=[# # #] It is not obvious to me from the description on CPAN or the PDL documentation what the values in $yfit are. Also it is not obvious what order it is returning the coefficients in. For the above example the coefficients are a*x^2+b*x+c, however I don't know if the coefficients are [a b c] or [c b a] or something else entirely. If you have any knowledge about the output of this function please let me know.
I'm not familiar with fitpoly1d but from the docs it appears that the $yfit output values correspond to evaluating the fitted function at the $x input points. As for the coefficients, I would guess the usual polynomial order as in a taylor expansion. I recommend playing around with some simple cases using the perldl or pdl2 interactive shells to see what works. Cheers, Chris _______________________________________________ Perldl mailing list [email protected] http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
