# start value for Davies minimization routines

### Description

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

### Usage

1 | ```
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 |

### 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 *lambda1=lambda2*, one with *lambda1=0*,
and one with *lambda2=0*). Returns the best one of the
three, as measured by `objective()`

.

### Author(s)

Robin K. S. Hankin

### See Also

`least.squares`

, `maximum.likelihood`

,
`objective`

### Examples

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ```
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.
``` |

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker. Vote for new features on Trello.