Davies (version 1.1-9)

davies.start: start value for Davies minimization routines

Description

Gives a “start” value for the optimization routines. Uses heuristics that seem to work.

Usage

davies.start(x, threeps=c(0.1,0.5,0.9), small = 0.01)

Arguments

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 \(\lambda_1\) and \(\lambda_1\) because using exactly zero is inappropriate

Details

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 \(\lambda_1= \lambda_2\), one with \(\lambda_1=0\), and one with \(\lambda_2=0\)). Returns the best one of the three, as measured by objective().

See Also

least.squares , maximum.likelihood, objective

Examples

Run this code
# NOT RUN {
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.

# }

Run the code above in your browser using DataCamp Workspace