You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Eric HENON <er...@univ-reims.fr> on 2013/04/17 07:52:03 UTC

non linear regression

Hello,

I need to perform a non linear regression using this 
 function: y = a + b lnx -c/x  (a,b,c) being the parameters.
I want to do this within the java language.

I have a set of points (y1,x1), (y2, x2), … (yn, xn).


The least square solver available in commons apache seemed
to me a possible way to solve this, but it needs the jacobian matrix,
which in my case, depends on the "c" parameter itself …

This, I don't know how to implement the MultiVariateMatrixFunction jacobian()
in this case. 

jacobian[i][0]= 1;
jacobian[i][1]= ln x;
jacobian[i][2]=  ???  (+c/x^2) ??
The problem is that the "c" parameter appears in the formula here...

Any help will be appreciated.
Thanks in advance.
Eric



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


[math] Re: non linear regression

Posted by Luc Maisonobe <Lu...@free.fr>.
Le 17/04/2013 08:12, eric henon a écrit :
> Sorry,
> 
> I made a mistake,
> I'm not used with Jacobian, 
> the jacobian[i][2]=  -1/x ...  (without c parameter ...)
> and it should be ok
> using the common apache MultivariateMatrixFunction jacobian ...

Yes, what is needed correspond to partial derivatives with respect to
the parameters used for the fitting. In this context, x is not a parameter.

Please also note that when writing to this list, you should use a marker
like [math] in the subject line if you write about the math component (I
have added it myself in this answer). The list is shared among all
Apache Commons components, and it helps filtering mail.

best regards,
Luc

> Eric.
> 
> 
> Le 17 avr. 2013 à 07:52, Eric HENON a écrit :
> 
>> Hello,
>>
>> I need to perform a non linear regression using this 
>> function: y = a + b lnx -c/x  (a,b,c) being the parameters.
>> I want to do this within the java language.
>>
>> I have a set of points (y1,x1), (y2, x2), … (yn, xn).
>>
>>
>> The least square solver available in commons apache seemed
>> to me a possible way to solve this, but it needs the jacobian matrix,
>> which in my case, depends on the "c" parameter itself …
>>
>> This, I don't know how to implement the MultiVariateMatrixFunction jacobian()
>> in this case. 
>>
>> jacobian[i][0]= 1;
>> jacobian[i][1]= ln x;
>> jacobian[i][2]=  ???  (+c/x^2) ??
>> The problem is that the "c" parameter appears in the formula here...
>>
>> Any help will be appreciated.
>> Thanks in advance.
>> Eric
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
> 
> Eric Henon
> Professeur
> Universite de Reims Champagne-Ardenne
> Institut de Chimie Moleculaire de Reims
> http://www.univ-reims.fr/ICMR
> CNRS UMR 6229
> UFR des Sciences Exactes et Naturelles
> BP 1039
> 51687 Reims Cedex 2 (France)                            
> Tél./Fax : + 33 (0) 3 26 91 84 97
> eric.henon@univ-reims.fr
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: non linear regression

Posted by eric henon <er...@univ-reims.fr>.
Sorry,

I made a mistake,
I'm not used with Jacobian, 
the jacobian[i][2]=  -1/x ...  (without c parameter ...)
and it should be ok
using the common apache MultivariateMatrixFunction jacobian ...
Eric.


Le 17 avr. 2013 à 07:52, Eric HENON a écrit :

> Hello,
> 
> I need to perform a non linear regression using this 
> function: y = a + b lnx -c/x  (a,b,c) being the parameters.
> I want to do this within the java language.
> 
> I have a set of points (y1,x1), (y2, x2), … (yn, xn).
> 
> 
> The least square solver available in commons apache seemed
> to me a possible way to solve this, but it needs the jacobian matrix,
> which in my case, depends on the "c" parameter itself …
> 
> This, I don't know how to implement the MultiVariateMatrixFunction jacobian()
> in this case. 
> 
> jacobian[i][0]= 1;
> jacobian[i][1]= ln x;
> jacobian[i][2]=  ???  (+c/x^2) ??
> The problem is that the "c" parameter appears in the formula here...
> 
> Any help will be appreciated.
> Thanks in advance.
> Eric
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
> 

Eric Henon
Professeur
Universite de Reims Champagne-Ardenne
Institut de Chimie Moleculaire de Reims
http://www.univ-reims.fr/ICMR
CNRS UMR 6229
UFR des Sciences Exactes et Naturelles
BP 1039
51687 Reims Cedex 2 (France)                            
Tél./Fax : + 33 (0) 3 26 91 84 97
eric.henon@univ-reims.fr


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org