Since no one has replied in 2 days, I will offer comments:
1. Your example is not self contained. When I copied your code
into R 2.4.0 and tried it just now, I got 'Error in fnoise(y) : object
"y" not found'. I don't know the answer to your question, and
I don't
know how I can answer it without a self-contained example.
2. Is it feasible for you to upgrade to a newer version? If you
are using a shared machine and can't get the system administrator to
upgrade, can you install R 2.4.0 in your own local space? Or can you
port your data to another machine where you can install the latest
version of R?
3. Have you worked the examples with the 'nlm' documentation?
When I've done this kind of thing in the past, I've sometimes found
problems with how I was trying to use the function.
4. Have you tried to cut your problem down to something much
simpler (and self contained)? If that does not lead you to an answer to
your question, it should at least provide something that could help
someone else help you.
I know my comments don't solve your problem, but hopefully they
will get you closer.
Spencer Graves
Robert Shnidman wrote:> Admittedly I am using an old version 1.7.1, but can anyone tell if this
> is or was a problem. I can only get nlm (nonlinear minimization) to
> adjust the first three components of function variable. No gradient or
> hessian is supplied. E.G.;
>
> fnoise
> function(y) { y[5]/(y[4]*sp2) * exp(-((x[,3]-y[1]-y[2]*x[,1]-y[3]
> *x[,2])/y[4])^2/2) + (1-y[5])/(y[9]*sp2) *
exp(-((x[,3]-y[6]-y[7]*x[,1]-y[8]
> *x[,2])/y[9])^2/2) }
>
>
nlm(sum(-log(fnoise(y))),c(5,1,1,10,.75,1,.2,.2,6),hessian=TRUE,print.level=2))
>
> Thanks,
> Bob
>
> ______________________________________________
> R-help at stat.math.ethz.ch 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.
>