davies.start | R Documentation |
Gives a “start” value for the optimization routines. Uses heuristics that seem to work.
davies.start(x, threeps=c(0.1,0.5,0.9), small = 0.01)
x |
dataset to be used |
threeps |
a three-element vector representing the quantiles to be balanced. The default values balance the first and ninth deciles and the median. These seem to work for me pretty well; YMMV |
small |
a “small” value to be used for lambda1 and lambda1 because using exactly zero is inappropriate |
Returns a “start” value of the pararameters for use in one of the
Davies fitting routines maximum.likelihood()
or least.squares()
.
Uses three heuristic methods (one assuming lambda1=lambda2, one with lambda1=0,
and one with lambda2=0). Returns the best one of the
three, as measured by objective()
.
Robin K. S. Hankin
least.squares
, maximum.likelihood
,
objective
d <- rchisq(40,1) davies.start(d) least.squares(d) params <- c(10 , 0.1 , -0.1) x <- rdavies(100 , params) davies.start(x) f <- function(threeps){objective(davies.start(x,threeps),x)} (jj<-optim(c(0.1,0.5,0.9),f)) davies.start(x,jj$par) least.squares(x) #not bad at all.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.