Description Generic function Methods Author(s) See Also Examples
The fmle
method fits the model specified in an FLModel
object using MLE
by minimizing the negative of the log-likelihood function, in the logl
slot,
through calls to the optim
minimizaton routine.
For a given model and log-likelihood function, the fmle
method will use the
optim
function in R to calculate the parameter vector which maximises the log-
likelihood (and, hence, the likelihood function) and is as such the optimum parameter
value for the given problem and data.
Be advised that for non-informative of conflicting data the maximum likelihood estimate can be dependent on the initial starting value and if we begin the optimiser with a poor initial estimate it may converge falsely. Always try multiple start points and be assured that you ave found the true MLE.
fmle(object,start)
Generic method.
Input object of class FLModel
contains input data, logl function and function to provide initial values.
Input object of class FLModel
contains input data and logl function, but fitting is started from parameter estimates in the FLPar
object provided.
The FLR Team
FLComp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | # use an example FLModel object
data(nsher)
summary(nsher)
# inspect the logl function
logl(nsher)
# and the function providing initial values to the optimizer
initial(nsher)
# lower and upper limits for the parameters are set, and used if method
# 'L-BFGS-B' is used in the call to optim, as is default in fmle
lower(nsher)
upper(nsher)
# fit it with fmle
nsher <- fmle(nsher)
# fixed values can be chosen for any parameter
nsher_fixed_a <- fmle(nsher, fixed=list(a=125))
# and results compared, for example using AIC
AIC(nsher)
AIC(nsher_fixed_a)
## Not run:
# an initial run with one optimization method, e.g. 'SANN'
nsher_one <- fmle(nsher, method='SANN')
# can then be used as starting value for other runs
# This might fail if
nsher_two <- fmle(nsher_one, start=params(nsher_one), method='L-BFGS-B')
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.