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 (x) gives the
probability that a sampled value is less than
. This is equivalent to saying that for
the vector of quantiles
at the corresponding probabilities
it holds that
In the case of arbitrary postulated quantiles this system of equations might not have a
solution in and
. A least squares fit leads to an approximate solution:
defines the parameters and
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:
=
p[[1]]
,=
0.5
and=
p[[2]]
;
=
ci[[1]]
,=
median
and=
ci[[2]]
-
median=NULL
: The parameters are fitted on the lower and upper value of the confidence interval only, formally:
=
p[[1]]
,=
p[[2]]
;
=
ci[[1]]
,=
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.