Peter Dalgaard <pdalgd <at> gmail.com> writes: > Issue #2 is stickier. I think I must say that the idelology of mle() is > that the user passes a likelihood function. If the likelihood function > depends on global data, and the user changes the global data, the user > deserves what he or she gets... It is pretty much impossible for mle() > to take an arbitrary function and detect which data it might depend on. > > You can go the bbmle route and pass in the data set as a data frame, but > then you lose the flexibility that a likelihood can depend on data that > doesn't fit within the single rectangular data frame.
For the record, bbmle doesn't require 'data' to be a data frame -- it can be any list of objects (most typically a data frame but not necessarily). I agree that one can accomplish all this with environments -- it's a matter of taste/style/what one thinks will be easier and more consistent in the long run for typical users. Ben ______________________________________________ R-help@r-project.org 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.