Le 31/12/2010 19:17, Vladimir Blagojevic a écrit :
> Mikkel,
>
> I looked at the example but I was not able to load my sample data and
> find coefficients of a quadratic equation. Lets say that I have data
> points for quadratic equation:
> double data[][] = { { 0, 1 }, { 1, 6 }, { 2, 17 } }; whic
Hi,
Quick answer. Remember that x*x has to be treated as an additional variable.
Think design matrices.
Cheers, Mikkel
Den 31/12/2010 19.18 skrev "Vladimir Blagojevic" :
> Mikkel,
>
> I looked at the example but I was not able to load my sample data and
> find coefficients of a quadratic equation
Mikkel,
I looked at the example but I was not able to load my sample data and
find coefficients of a quadratic equation. Lets say that I have data
points for quadratic equation:
double data[][] = { { 0, 1 }, { 1, 6 }, { 2, 17 } }; which is in fact
y(x) = 1 + 2x + 3x^2
How would I setup either OLS
Hi,
Try to have a look at the examples provided at
http://commons.apache.org/math/userguide/stat.html#a1.5_Multiple_linear_regression
. Both OLS and GLS are supported.
If you have further questions, do not hesitate to ask!
Cheers, Mikkel.
2010/12/30 Vladimir Blagojevic :
> Hi,
>
> I am not sure
Hi,
I am not sure how, if at all, I can use math package to apply
least-squares approximation to find coefficients to n-order equation:
y = a0*X^0 + a1*X^1 + ... + an*X^n.
More specifically, given a set of x,y data points I would like to find
quadratic equations that best fits the input data point