Description Usage Arguments Value Author(s) See Also Examples
Estimating coefficients of logitnormal distribution from a vector of quantiles and perentiles (non-vectorized).
1 2 3 4 5 6 7 |
quant |
the quantile values |
perc |
the probabilites for which the quantiles were specified |
method |
method of optimization (see |
theta0 |
starting parameters |
returnDetails |
if TRUE, the full output of optim is returned instead of only entry par |
... |
further parameters passed to optim, e.g. control=list(maxit=1000) |
named numeric vector with estimated parameters of the logitnormal distrubtion.
names: c("mu","sigma")
Thomas Wutzler
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | # experiment of re-estimation the parameters from generated observations
thetaTrue <- c(mu=0.8, sigma=0.7)
obsTrue <- rlogitnorm(thetaTrue["mu"],thetaTrue["sigma"], n=500)
obs <- obsTrue + rnorm(100, sd=0.05) # some observation uncertainty
plot(density(obsTrue),col="blue"); lines(density(obs))
# re-estimate parameters based on the quantiles of the observations
(theta <- twCoefLogitnorm( median(obs), quantile(obs,probs=0.9), perc = 0.9))
# add line of estimated distribution
x <- seq(0,1,length.out=41)[-c(1,41)] # plotting grid
dx <- dlogitnorm(x,mu=theta[1],sigma=theta[2])
lines( dx ~ x, col="orange")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.