[R] non-linear model parameterization

Moshe Olshansky m_olshansky at yahoo.com
Mon Oct 1 04:51:46 CEST 2007

Hi Irene,

In this case the computer is right - your gradient is
really singular!
If you scale all you parameters (g,a and b) by any
nonzero constant c nothing changes, meaning that there
is a "degree of freedom" and this causes the gradient
to be singular.
You can check whether g = 0 (and then y = 0) is good.
If not, assume that g != 0 and divide both numerator
and denominator by g to get y = x/(A + B*x) where A =
a/g, B = b/g.
Now your gradient should not be singular.
Formally, if y = x/(A + B*x) then 1/y = A/x + B or 
y' = B + A*x' where y' = 1/y and x' = 1/x, and this is
a linear model! You certainly can not use it to
estimate A and B, but you can try to use the values
for A and B you get as an initial estimate for nls for
the original model (if you do not have a better
starting point).



--- Irene Mantzouni <ima at difres.dk> wrote:

> Dear all,
> I would like to fit a non-linear model of the form:
> y=g*x/(a+b*x)
> with nls().
> However this model is somehow overparameterized and
> I get the error message about
> singular gradient matrix at initial parameter
> estimates.
> What I am interested in is to make inference about
> parameters b and g, so this has to be taken into
> account in the model formulation. 
> What options do I have?
> Also, how is it possible to fit a partially linear
> model? 
> Thank you!!
> Irene Mantzouni
> ----------------
> PhD student
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained,
> reproducible code.

More information about the R-help mailing list