Least Squares

A

alexxx.magni

Hi everybody,
I need to perform a huge number of Least Squares Fits to my data,
using probably something like a+b*Atan(c-d*x) as the fitting function.
Can you suggest me the fastest package on CPAN, according to you?

Thanks for any help!


Alessandro Magni
 
A

A. Sinan Unur

I need to perform a huge number of Least Squares Fits to my data,
using probably something like a+b*Atan(c-d*x) as the fitting function.
Can you suggest me the fastest package on CPAN, according to you?

First off, if you can't reduce that functional form to a form that is
linear in parameters, you are going to need to resort to numerical
optimization.

Second, I would be more inclined to open a pipe to R or Octave (I have no
idea if they can do this particular estimation) for any serious statistics.

Finally, you do not mention what you mean by 'fast'.

Sinan
 
A

alexxx.magni

First off, if you can't reduce that functional form to a form that is
linear in parameters, you are going to need to resort to numerical
optimization.

It could be still OK for me - do you know of any module able to do
this?
Second, I would be more inclined to open a pipe to R or Octave (I have no
idea if they can do this particular estimation) for any serious statistics.

I'm not an expert on R/Octave, but sometimes I tried linking C and
Mathematica - I dont know if Perl can handle this...
Finally, you do not mention what you mean by 'fast'.

Well, the project involves the processing of simple PGM images (0..255
graylevels) of an interface swapping the image, turning it from black
to white.
So every pixel of the 691x517 images (300 of them!) will behave in
time (time=1..300) approximately as a step function (thats why I use
Atan) with noise overimposed.
I "simply" need to know, for every pixel, at which time the step
appears, to be able to precisely reconstruct the interface.
.... that's what I meant by "fast"!


thanks for your help,

Alessandro
 
A

A. Sinan Unur

It could be still OK for me - do you know of any module able to do
this?
No.


I'm not an expert on R/Octave, but sometimes I tried linking C and
Mathematica - I dont know if Perl can handle this...

Perl can handle all sorts of things but at this point your problem
is too ambiguously specified. Anything I say will be pure speculation
and likely wrong for your problem.

Well, the project involves the processing of simple PGM images (0..255
graylevels) of an interface swapping the image, turning it from black
to white.
So every pixel of the 691x517 images (300 of them!) will behave in
time (time=1..300) approximately as a step function (thats why I use
Atan) with noise overimposed.
I "simply" need to know, for every pixel, at which time the step
appears, to be able to precisely reconstruct the interface.
... that's what I meant by "fast"!

Again, this is too ambiguous for me. What is x and what is y in the
equation you specified above? What does it mean to
'reconstruct the interface'?

Take a look at:

http://cran.r-project.org/doc/contrib/Fox-Companion/appendix-nonlinear-regression.pdf

Read perldoc perlipc and perldoc IPC::Open3. I would be inclined to
open a pipe to an external program (such as R) at the beginning of your
script and let that program perform the computations.

Sinan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top