[R-sig-ME] start values for starting parameters, factors [SEC=UNCLASSIFIED]

Gosse, Michelle Michelle.Gosse at foodstandards.gov.au
Thu Jan 12 21:09:19 CET 2012


Hi Doug,

Thanks for replying and thanks also to Steve for his comments.

I agree with your comments below, and am following this point up with the people who made the request to use this method. In case anyone is interested, the method is outlined in this paper, section  3.2: http://www.stat.tamu.edu/~carroll/ftp/2011.papers.directory/NCIMethod_aspublished.pdf

I appreciate the time that people have put into this for me, it has helped me out a lot on the conceptual perspective as well as the nlme specification perspective.

Cheers
Michelle



-----Original Message-----
From: dmbates at gmail.com [mailto:dmbates at gmail.com] On Behalf Of Douglas Bates
Sent: Friday, January 13, 2012 8:51 AM
To: Gosse, Michelle
Cc: r-sig-mixed-models at r-project.org
Subject: Re: [R-sig-ME] start values for starting parameters, factors [SEC=UNCLASSIFIED]

On Wed, Jan 11, 2012 at 9:13 PM, Gosse, Michelle <Michelle.Gosse at foodstandards.gov.au> wrote:
> Hi again,
>
> More reading later, and I have the following model with the log likelihood function specified:
> male.lme2 <- lme(BoxCoxXY ~ ordered(AgeFactor) + IntakeDay,
>                                    data=Male.Group,
>                                    random= ~1|RespondentID)
>
> male.nlme <- nlme(IntakeAmt ~ log(1/sqrt(2*pi*(Scale^2))) +
>                                                
> (-(A*BoxCoxXY-(B*AgeFactor +
> C*IntakeDay))^2)/(2*Scale)+(Lambda.Value-1)*log(IntakeAmt),
>                                    data=Male.Group,
>                                    fixed = A - B + C ~ 1,
>                                    random = A ~ 1|RespondentID,
>                                    start=fixef(male.lme2)
>                                    )
>
> The nlme syntax gives me the error:
> "Error in nlme.formula(IntakeAmt ~ log(1/sqrt(2 * pi * (Scale^2))) + (-(A * :
>            starting values for the fixed component are not the correct length"
>
> Reading on the internet made me understand that this is because there needs to be 3 fixed component start parameters, as confirmed by the model below not giving that error:
> male.nlme <- nlme(IntakeAmt ~ log(1/sqrt(2*pi*(Scale^2))) +
>                                                
> (-(A*BoxCoxXY-(B*AgeFactor +
> C*IntakeDay))^2)/(2*Scale)+(Lambda.Value-1)*log(IntakeAmt),
>                                    data=Male.Group,
>                                    fixed = A - B + C ~ 1,
>                                    random = A ~ 1|RespondentID,
>                                    start=c(A=1,B=1,C=1)
>                                    )
>
> The test model immediately above gives the error:
> "Error in chol.default((value + t(value))/2) :
>            the leading minor of order 1 is not positive definite"
>
> Which I think is occurring because of the warning messages:
> 1: In Ops.ordered(B, AgeFactor) :
>            '*' is not meaningful for ordered factors
> 2: In Ops.factor(C, IntakeDay) : * not meaningful for factors
>
> Given that I have 3 AgeFactor and 1 IntakeDay parameters, as there are 4 and 2 factor levels respectively (lowest level omitted for each), how do I specify the nlme model and fixed effects without changing to dummy variable coding?
>
> Sorry for all my questions on this, at least this time I get the error on step 14 of the traceback() so I feel I am coming to grips with nlme slowly.

Well, as the messages say, it doesn't make sense to multiply AgeFactor by B and IntakeDay by C.

You really should start from the beginning and decide what the model you are trying to fit is.  It must be an expression in which every name is a parameter or a covariate name or the name of a function.
The names of the parameters are determined by the names of the start argument.  The names of the covariates are those in Male.Group.  Do these include IntakeAmt, Scale and Lambda?

Also, it is unusual and generally misguided to include IntakeAmt on both the left and the right hand side of the formula.

We don't know why you are using the expressions that you are and it probably won't be productive to continue to guess what form the model expression should be then report error messages to us.

UNCLASSIFIED

**********************************************************************
This email and any files transmitted with it are confide...{{dropped:9}}




More information about the R-sig-mixed-models mailing list