Davies (version 1.1-9)

least.squares: 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()

Value

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

Details

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

See Also

davies.start, optim, objective, likelihood

Examples

Run this code
# NOT RUN {
p <- c(10 , 0.1 , 0.1)
d <- rdavies(50,p)
system.time(print(maximum.likelihood(d)))
                           #observe how long this takes.
                           #The time is taken in repeated calls
                           #to pdavies(), which uses uniroot().

system.time(print(least.squares(d)))
                           #Much faster.
# }

Run the code above in your browser using DataCamp Workspace