least.squares | R Documentation |
Finds the best-fit Davies distribution using either the least-squares
criterion (least.squares()
) or maximum likelihood
(maximum.likelihood()
)
least.squares(data, do.print = FALSE, start.v = NULL) maximum.likelihood(data, do.print = FALSE, start.v = NULL)
data |
dataset to be fitted |
do.print |
Boolean with |
start.v |
A suitable starting vector of parameters
|
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.
Returns the parameters C,lambda1,lambda2 of
the best-fit Davies distribution to the dataset data
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()
.
Robin K. S. Hankin
davies.start
, optim
,
objective
, likelihood
p <- c(10 , 0.1 , 0.1) d <- rdavies(10,p) maximum.likelihood(d) # quite slow least.squares(d) # much faster but not recommended
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.