least.squares {Davies}R Documentation

Finds the optimal Davies distribution for a dataset

Description

Finds the best-fit Davies distribution using either the least-squares criterion (least.squares()) or maximum likelihood (maximum.likelihood())

Usage

least.squares(data, do.print = FALSE, start.v = NULL)
maximum.likelihood(data, do.print = FALSE, start.v = NULL)

Arguments

data

dataset to be fitted

do.print

Boolean with TRUE meaning print a GFM

start.v

A suitable starting vector of parameters c(C,lambda1,lambda2), with default NULL meaning to use start()

Details

Uses optim() to find the best-fit Davies distribution to a set of data.

Function least.squares() does not match that of Hankin and Lee 2006.

Value

Returns the parameters C,\lambda_1,\lambda_2 of the best-fit Davies distribution to the dataset data

Note

BUGS:

Function least.squares() does not use the same methodology of Hankin and Lee 2006, and its use is discouraged pending implentation.

Quite apart from that, it can be screwed with bad value for start.v. Function maximum.likelihod() can be very slow. It might be possible to improve this by using some sort of hot-start for optim().

Author(s)

Robin K. S. Hankin

See Also

davies.start, optim, objective, likelihood

Examples


  p <- c(10 , 0.1 , 0.1)
  d <- rdavies(10,p)

  maximum.likelihood(d)  # quite slow
  least.squares(d)       # much faster but not recommended

[Package Davies version 1.2-0 Index]