There is an error in your call to `optim'.  The`lower' bound is incorrect:

lower=c(rep(-1,n),1e-5,1e-5,1e5)

This should be:

lower=c(rep(-1,n),1e-5,1e-5,1e-5)

I am not sure if this fixes the problem, but it is worth a try.

I do not understand your scaling.  From the lower and upper bounds it seems like (n+2)th parameter is the only one that needs to be scaled by a scale factor of 100.

After you have fixed the error in `lower' and the scaling, you might also want to try "optimx" package that runs a bunch of optimization algorithms.

Ravi.
-------------------------------------------------------
Ravi Varadhan, Ph.D.
Assistant Professor,
Division of Geriatric Medicine and Gerontology School of Medicine Johns Hopkins University

Ph. (410) 502-2619
email: rvaradhan@jhmi.edu<mailto:rvaradhan@jhmi.edu>


	[[alternative HTML version deleted]]

