Re: [R] nls

From: Gabor Grothendieck <>
Date: Wed 20 Jul 2005 - 12:25:14 EST

On 7/19/05, <> wrote:
> Dear R-helpers,
> I am trying to estimate a model that I am proposing, which consists of putting
> an extra hidden layer in the Markov switching models. In the simplest case the
> S(t) - Markov states - and w(t) - the extra hidden variables - are independent,
> and w(t) is constant. Formally the model looks like this:
> y(t)=c(1,y[t-1])%*%beta0*w+c(1,y[t-1])%*%beta1*(1-w). So I ran some simulations
> to obtain the y's, and I am putting it into the nls:
> res<-nls(y~(a+b*x)*w+(c+d*x)*(1-w),start=list(a=1,b=0.3,c=-1,d=-0.2,w=0.5))
> and the starting parameter values are similar to the ones I used for
> simulations, however I am getting
> Error in nlsModel(formula, mf, start) : singular gradient matrix at initial
> parameter estimates

Your model is not identifiable. You are using 5 parameters to describe a two dimensional model -- in fact, y is linear in x so anything beyond the intercept and slope are redundant, viz. a singular gradient. mailing list PLEASE do read the posting guide! Received on Wed Jul 20 12:29:30 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:50 EST