views:

53

answers:

1

I have a set of data (in ArrayCollection) and I need to fit a power function { f(x)= B + x^alpha } to it, before display in LineChart. As result I need the alpha and B paremeter.

How to do this with Flex?

A: 

You're trying to solve a nonlinear regression. As explained on the latter page, you can use a method of steepest descent, or the Gauss-Newton algorithm.

Here is an online example. You can try out a fitting by entering data, and in box 4 enter the formula a+Power(x,b). The method used there is called the method of differential correction, but I believe that is the same as Gauss-Newton. The solver is implemented in Javascript, which is closely related to ActionScript, so you might be able to follow the code there.

There is a worked example of the method on this page.

brainjam