twCoefLogitnormE: twCoefLogitnormE

Description Usage Arguments Value Author(s) See Also Examples

Description

Estimating coefficients of logitnormal distribution from expected value, i.e. mean, and upper quantile.

Usage

1
2
3
4
5
6
7
twCoefLogitnormE(mean, quant, perc = c(0.975), method = "BFGS", 


    theta0 = c(mu = 0, sigma = 1), returnDetails = FALSE, 


    ...)

Arguments

mean

the expected value of the density function

quant

the quantile values

perc

the probabilites 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 with attribut resOptim

...

Value

named numeric matrix with estimated parameters of the logitnormal distrubtion.

colnames: c("mu","sigma")

Author(s)

Thomas Wutzler

See Also

logitnorm

Examples

 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
38
39
40
# estimate the parameters


(thetaE <- twCoefLogitnormE(0.7,0.9))





x <- seq(0,1,length.out=41)[-c(1,41)]	# plotting grid


px <- plogitnorm(x,mu=thetaE[1],sigma=thetaE[2])	#percentiles function


plot(px~x); abline(v=c(0.7,0.9),col="gray"); abline(h=c(0.5,0.975),col="gray")


dx <- dlogitnorm(x,mu=thetaE[1],sigma=thetaE[2])	#density function


plot(dx~x); abline(v=c(0.7,0.9),col="gray")





z <- rlogitnorm(1e5, mu=thetaE[1],sigma=thetaE[2])


mean(z)	# about 0.7





# vectorized


(theta <- twCoefLogitnormE(mean=seq(0.4,0.8,by=0.1),quant=0.9))

logitnorm documentation built on May 2, 2019, 6:15 p.m.