Marie didier
2011-Feb-15 08:43 UTC
[R] "Error : singular gradient matrix at initial parameters estimates"
Dear all, I am a fresh user of R and I already face to problems that I don't understand. In the use of the function nls(), I systematically have an error message : "Singular gradient matrix at initial parameters estimates". I tried to use nls() on a set of data that I subseted from a bigger matrix data. I wish to fit a gaussian on these points (spectrum) and draw this fit on the plot. Is this possible? Why do I always have this error message when using nls() ? Thank you for your answers, and don't make fun of me :) because, as I said, I am a fresh novice :) [[alternative HTML version deleted]]
Mike Marchywka
2011-Feb-15 12:32 UTC
[R] "Error : singular gradient matrix at initial parameters estimates"
----------------------------------------> Date: Tue, 15 Feb 2011 09:43:25 +0100 > From: mariedidier1 at gmail.com > To: r-help at r-project.org > Subject: [R] "Error : singular gradient matrix at initial parameters estimates" > > Dear all, > > I am a fresh user of R and I already face to problems that I don't > understand. > In the use of the function nls(), I systematically have an error message : > "Singular gradient matrix at initial parameters estimates". > I tried to use nls() on a set of data that I subseted from a bigger matrix > data. I wish to fit a gaussian on these points (spectrum) and draw this fit > on the plot. > Is this possible? Why do I always have this error message when using nls() ?I guess this is because when it is evaluated at the initial parameter estimates your gradient matrix is, well, singular :) Error messages are often not literally accurate but in this case it would probably be good to start there. So, your question is probably " how do I dump the initial parameter values and evaluate the gradient matrix and determine what makes it pathological?" The first part being R related, the second may or may not be. It could turn out just to be a typo making something all zeroes maybe, or just badly conditioned etc.> > Thank you for your answers, and don't make fun of me :) because, as I said, > I am a fresh novice :)I've gotten pretty good at trying to look for alternative questions in response to ill-defined ones such as, " are you an idiot?" LOL. If no one here makes fun of you eventually your data probably will or else you really haven't analyzed it enough :)
Ben Bolker
2011-Feb-15 13:14 UTC
[R] "Error : singular gradient matrix at initial parameters estimates"
Marie didier <mariedidier1 <at> gmail.com> writes:> I am a fresh user of R and I already face to problems that I don't > understand. > In the use of the function nls(), I systematically have an error message : > "Singular gradient matrix at initial parameters estimates". > I tried to use nls() on a set of data that I subseted from a bigger matrix > data. I wish to fit a gaussian on these points (spectrum) and draw this fit > on the plot. > Is this possible? Why do I always have this error message when using nls() ? > > Thank you for your answers, and don't make fun of me :) because, as I said, > I am a fresh novice :) >We won't make fun of you, but we will chide you for not giving us enough information to help you solve your problem. "Singular gradient matrix at initial parameter estimates" means that there is a 'flat' or nearly flat direction in parameter space at the point where you tried to start the optimization. This can be a symptom of: * a model with unidentifiable (i.e. perfectly correlated) parameters * bad choices of starting parameters Please read the Posting Guide (referenced at the bottom of every post) and try again. What are the *specific* R commands you are trying to run? Can you give us a reproducible example? Ben Bolker
Seemingly Similar Threads
- Non linear Regression: "singular gradient matrix at initial parameter estimates"
- Error "singular gradient matrix at initial parameter estimates" in nls
- Error "singular gradient matrix at initial parameter estimates" in nls
- nls problem: singular gradient
- SSweibull() : problems with step factor and singular gradient