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" <dovlex@gmail.com>:
> 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 and/or GLS MultipleLinearRegression
> objects to load this data and find the coefficients.
>
> Much appreciated,
> Vladimir
>
> 2010/12/30 Mikkel Meyer Andersen <mikl@mikl.dk>:
>> 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 <dovlex@gmail.com>:
>>> Hi,
>>>
>>> I am not sure how, if at all, I can use math package to apply
>>> leastsquares approximation to find coefficients to norder 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 points.
>>>
>>> Regards,
>>> Vladimir
>>>
>>> 
>>> To unsubscribe, email: userunsubscribe@commons.apache.org
>>> For additional commands, email: userhelp@commons.apache.org
>>>
>>>
>>
>> 
>> To unsubscribe, email: userunsubscribe@commons.apache.org
>> For additional commands, email: userhelp@commons.apache.org
>>
>>
>
> 
> To unsubscribe, email: userunsubscribe@commons.apache.org
> For additional commands, email: userhelp@commons.apache.org
>
