Fit the Normal Laplace Distribution to Data
Description
Fits a normal Laplace distribution to data. Displays the histogram, loghistogram (both with fitted densities), QQ plot and PP plot for the fit which has the maximum likelihood.
Usage
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24  nlFit(x, freq = NULL, breaks = "FD", paramStart = NULL,
startMethod = "NelderMead",
startValues = c("MoM", "US"),
method = c("NelderMead", "BFGS", "LBFGSB",
"nlm", "nlminb"),
hessian = FALSE,
plots = FALSE, printOut = FALSE,
controlBFGS = list(maxit = 200),
controlLBFGSB = list(maxit = 200),
controlNLMINB = list(),
controlNM = list(maxit = 1000),
maxitNLM = 1500, ...)
## S3 method for class 'nlFit'
print(x, digits = max(3, getOption("digits")  3), ...)
## S3 method for class 'nlFit'
plot(x, which = 1:4,
plotTitles = paste(c("Histogram of ","LogHistogram of ",
"QQ Plot of ","PP Plot of "), x$obsName,
sep = ""),
ask = prod(par("mfcol")) < length(which) & dev.interactive(), ...)
## S3 method for class 'nlFit'
coef(object, ...)
## S3 method for class 'nlFit'
vcov(object, ...)

Arguments
x 
Data vector for 
freq 
A vector of weights with length equal to 
breaks 
Breaks for plotted histogram, defaults to those generated by

paramStart 
A user specified starting parameter vector taking the form

startMethod 
Method used by 
startValues 
Code giving the method of determining starting values for finding the maximum likelihood estimate of the parameters. 
method 
Different optimisation methods to consider. See Details. 
hessian 
Logical. If 
plots 
Logical. If 
printOut 
Logical. If 
controlBFGS 
A list of control parameters for 
controlLBFGSB 
A list of control parameters for 
controlNLMINB 
A list of control parameters for 
controlNM 
A list of control parameters for 
maxitNLM 
A positive integer specifying the maximum number of
iterations that are to be undertaken when using the 
object 
Object of class 
digits 
Desired number of digits to be shown when the object is printed. 
which 
If a subset of the plots if required, specify a subset of
the numbers 
plotTitles 
Titles to appear as the main title above the plots. 
ask 
Logical. If 
... 
Passes arguments to 
Details
startMethod
must be "NelderMead"
.
startValues
can only be "MoM"
when using the Method of
Moments for estimation, or "US"
for usersupplied parameters. For
details regarding the use of paramStart
, startMethod
and
startValues
, see nlFitStart
.
Three optimisation methods are available for use:
"BFGS"
Uses the quasiNewton method"BFGS"
as documented inoptim
."LBFGSB"
Uses the constrained method"LBFGSB"
as documented inoptim
."NelderMead"
Uses an implementation of the Nelder and Mead method as documented inoptim
."nlm"
Uses thenlm
function in R."nlminb"
Uses thenlminb
function in R, with constrained parameters.
For details on how to pass control information for optimisation using
optim
and nlm
, see optim
and
nlm
.
When method = "nlm"
or method = "nlm"
is used, warnings
may be produced. However, these do not appear to be problematic.
Value
A list with components:
param 
A vector giving the maximum likelihood estimate of
parameters, as

maxLik 
The value of maximised loglikelihood. 
hessian 
If 
method 
Optimisation method used. 
conv 
Convergence code. See the relevant documentation (either

iter 
Number of iterations made by the optimisation routine. 
obs 
The data used to fit the normal Laplace distribution. 
obsName 
A character vector with the actual 
paramStart 
Starting value of parameters returned by call to

svName 
Descriptive name for the method of finding start values. 
startValues 
Acronym for the method of finding start values. 
breaks 
The cell boundaries found by a call to

midpoints 
The cell midpoints found by a call to

empDens 
The estimated density found by a call to

Author(s)
David Scott d.scott@auckland.ac.nz, Simon Potter
See Also
optim
, nlm
, par
,
hist
, logHist
, qqnl
,
ppnl
, dnl
and
nlFitStart
.
Examples
1 2 3 4 5 6 7 8 9 