# nlFitStart: Find Starting Values for Fitting a Normal Laplace... In NormalLaplace: The Normal Laplace Distribution

## Description

Finds starting values for input to a maximum likelihood routine for fitting a normal Laplace distribution to data.

## Usage

 ```1 2 3 4 5``` ``` nlFitStart(x, breaks = "FD", paramStart = NULL, startValues = c("MoM", "US"), startMethodMoM = "Nelder-Mead", ...) nlFitStartMoM(x, startMethodMoM = "Nelder-Mead", ...) ```

## Arguments

 `x` Data vector. `breaks` Breaks for histogram. If missing, defaults to those generated by `hist(x, right = FALSE, plot = FALSE)`. `paramStart` Starting values for parameter vector if `startValues = "US"`. `startValues` Vector of the different starting value methods to consider. See Details. `startMethodMoM` Method used by call to `optim` in finding method of moments estimates. `...` Passes arguments to `optim`.

## Details

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`.

## Value

`nlFitStart` returns a list with components:

 `paramStart` A vector with elements `mu`, `sigma`, `alpha` and `beta` giving the starting value of param. `xName` A character string with the actual `x` argument name. `breaks` The cell boundaries found by a call to `hist`. `midpoints` The cell midpoints found by a call to `hist`. `empDens` 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`.

## Author(s)

David Scott [email protected], Simon Potter

`dnl`, `nlFit`, `hist`, and `optim`.

## Examples

 ```1 2 3``` ```param <- c(2, 2, 1, 1) dataVector <- rnl(500, param = param) nlFitStart(dataVector, startValues = "MoM") ```

### Example output

```Loading required package: DistributionUtils
\$paramStart
mu      sigma      alpha       beta
-0.3619088  2.0841455  4.3473020 10.5877088

\$breaks
[1] -12 -10  -8  -6  -4  -2   0   2   4   6   8  10  12

\$midpoints
[1] -11  -9  -7  -5  -3  -1   1   3   5   7   9  11

\$empDens
[1] 0.004 0.010 0.038 0.052 0.076 0.079 0.081 0.077 0.044 0.025 0.010 0.004

\$svName
[1] "Method of Moments"

\$startValues
[1] "MoM"
```

NormalLaplace documentation built on May 29, 2017, 12:23 p.m.