Re: [R] scaling problems in "optim"

2008-03-23 Thread Spencer Graves
p.s. With proper scaling, 'optim' gives the correct answer in this case: (mle2 <- optim(rep(0, 2), dmvnorm, method='CG', control=list(fnscale=-10, trace=9), mean=1:2, hessian=TRUE, log=TRUE)) $par [1] 0.917 1.833 However, as noted below, with parscale

Re: [R] scaling problems in "optim"

2008-03-23 Thread Spencer Graves
ALL: Can anyone explain why optim returns c(0.75, 2) for what I think should be the maximum of a bivariate normal density with mean = 1:2? KATHIE: Apart from 'optim' giving an answer I don't understand, the following should illustrate the use of 'fnscale' and 'parscale' -- whil

Re: [R] scaling problems in "optim"

2008-03-23 Thread Peter Dalgaard
kathie wrote: > Dear R users, > > I am trying to figure out the control parameter in "optim," especially, > "fnscale" and "parscale." > > In the R docu., > > -- > fnscale > > An overall scaling to be applied to the value of fn and gr during >

[R] scaling problems in "optim"

2008-03-23 Thread kathie
Dear R users, I am trying to figure out the control parameter in "optim," especially, "fnscale" and "parscale." In the R docu., -- fnscale An overall scaling to be applied to the value of fn and gr during optimization. If negative, turns