Re: [Rd] Behaviour of mle and environments or calling mle inside a function

2007-06-26 Thread Prof Brian Ripley
On Tue, 26 Jun 2007, Iago Mosqueira wrote: > Dear all, > > I would appreciate some help understanding the following behaviour > when stats4::mle is called inside a function. mle seems to look for > its arguments in R_GlobalEnv and not the environment from which it is > called. It is your function

[Rd] Behaviour of mle and environments or calling mle inside a function

2007-06-26 Thread Iago Mosqueira
Dear all, I would appreciate some help understanding the following behaviour when stats4::mle is called inside a function. mle seems to look for its arguments in R_GlobalEnv and not the environment from which it is called. library(stats4) lkhd <- function(alpha=1, beta=0.1, sigma=0.1) -