Finds starting values for input to a maximum likelihood routine for fitting a normal Laplace distribution to data.
nlFitStart(x, breaks = "FD",
paramStart = NULL,
startValues = c("MoM", "US"),
startMethodMoM = "Nelder-Mead", ...)
nlFitStartMoM(x, startMethodMoM = "Nelder-Mead", ...)
nlFitStart
returns a list with components:
A vector with elements mu
, sigma
,
alpha
and beta
giving the starting value of param.
A character string with the actual x
argument name.
The cell boundaries found by a call to
hist
.
The cell midpoints found by a call to
hist
.
The estimated density found by a call to
hist
.
nlFitStartMoM
returns only the method of moments estimates
as a vector with elements mu
, sigma
, alpha
and
beta
.
Data vector.
Breaks for histogram. If missing, defaults to those
generated by
hist(x, right = FALSE, plot = FALSE)
.
Starting values for parameter vector if
startValues = "US"
.
Vector of the different starting value methods to consider. See Details.
Method used by call to optim
in
finding method of moments estimates.
Passes arguments to optim
.
David Scott d.scott@auckland.ac.nz, Simon Potter
Possible values of the argument startValues
are the following:
"US"
User-supplied.
"MoM"
Method of moments.
If startValues = "US"
then a value must be supplied for
paramStart
.
If startValues = "MoM"
, nlFitStartMoM
is
called.
If startValues = "MoM"
an initial optimisation is needed to find
the starting values. These optimisations call optim
.
param <- c(2, 2, 1, 1)
dataVector <- rnl(500, param = param)
nlFitStart(dataVector, startValues = "MoM")
Run the code above in your browser using DataLab