# The objective function for fitting the Davies distribution

### Description

The “distance” of a dataset from a particular Davies distribution

### Usage

1 2 | ```
objective(params, dataset)
objective.approx(params, dataset)
``` |

### Arguments

`params` |
A three-member vector holding |

`dataset` |
The dataset to be considered |

### Details

Used by the `fit.davies.p()`

and `fit.davies.q()`

functions

### Value

`objective`

returns the “distance” of a
dataset from a particular
Davies distribution as measured by the sums of the squares of the
differences between observed (`dataset`

) and
expected (`expected.value()`

) values.

`objective.approx()`

uses `expected.approx()`

rather than
`expected()`

to calculate expectations, as per equation 6.

### Author(s)

Robin K. S. Hankin

### See Also

`fit.davies.p`

, `fit.davies.q`

### Examples

1 2 3 4 5 6 7 8 | ```
params <- c(10, 0.1, 0.1)
x <- rdavies(100,params)
objective(params,x)
objective.approx(params,x)
objective(least.squares(x),x)
objective(davies.start(x),x)
``` |

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker. Vote for new features on Trello.