twCoefLogitnormN: twCoefLogitnormN

Description Usage Arguments Value Author(s) See Also Examples

View source: R/logitnorm.R

Description

Estimating coefficients from a vector of quantiles and perentiles (non-vectorized).

Usage

1
2
3
twCoefLogitnormN(quant, perc = c(0.5, 0.975), 
    method = "BFGS", theta0 = c(mu = 0, sigma = 1), 
    returnDetails = FALSE, ...)

Arguments

quant

the quantile values

perc

the probabilities for which the quantiles were specified

method

method of optimization (see optim)

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)

Value

named numeric vector with estimated parameters of the logitnormal distribution. names: c("mu","sigma")

Author(s)

Thomas Wutzler

See Also

logitnorm

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# 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")

logitnorm documentation built on May 1, 2019, 11:01 p.m.