paramtnormci_fit {decisionSupport} | R Documentation |
Fit parameters of truncated normal distribution based on a confidence interval.
Description
This function fits the distribution parameters, i.e. mean
and sd
, of a truncated
normal distribution from an arbitrary confidence interval and, optionally, the median.
Usage
paramtnormci_fit(
p,
ci,
median = mean(ci),
lowerTrunc = -Inf,
upperTrunc = Inf,
relativeTolerance = 0.05,
fitMethod = "Nelder-Mead",
...
)
Arguments
p |
|
ci |
|
median |
if |
lowerTrunc |
|
upperTrunc |
|
relativeTolerance |
|
fitMethod |
optimization method used in |
... |
further parameters to be passed to |
Details
For details of the truncated normal distribution see tnorm
.
The cumulative distribution of a truncated normal F_{\mu, \sigma}
(x) gives the
probability that a sampled value is less than x
. This is equivalent to saying that for
the vector of quantiles q=(q(p_1),
\ldots, q(p_k))
at the corresponding probabilities p=(p_1, \ldots, p_k)
it holds that
p_i = F_{\mu, \sigma}(q_{p_i}),~i = 1, \ldots, k
In the case of arbitrary postulated quantiles this system of equations might not have a
solution in \mu
and \sigma
. A least squares fit leads to an approximate solution:
\sum_{i=1}^k (p_i - F_{\mu, \sigma}(q_{p_i}))^2 = \min
defines the parameters \mu
and \sigma
of the underlying normal distribution. This
method solves this minimization problem for two cases:
-
ci[[1]] < median < ci[[2]]
: The parameters are fitted on the lower and upper value of the confidence interval and the median, formally:
k=3
p_1
=p[[1]]
,p_2
=0.5
andp_3
=p[[2]]
;
q(p_1)
=ci[[1]]
,q(0.5)
=median
andq(p_3)
=ci[[2]]
-
median=NULL
: The parameters are fitted on the lower and upper value of the confidence interval only, formally:
k=2
p_1
=p[[1]]
,p_2
=p[[2]]
;
q(p_1)
=ci[[1]]
,q(p_2)
=ci[[2]]
The (p[[2]]-p[[1]])
- confidence interval must be symmetric in the sense that
p[[1]] + p[[2]] = 1
.
Value
A list with elements mean
and sd
, i.e. the parameters of the underlying
normal distribution.