beta-utils {LambertW} | R Documentation |
Utilities for parameter vector beta of the input distribution
Description
The parameter specifies the input distribution
.
beta2tau
converts to the transformation vector
, which
defines the Lambert W
F random variable mapping from
to
(see
tau-utils
). Parameters and
of
in general depend on
(and may not even exist for
use.mean.variance = TRUE
; in this case
beta2tau
will throw an error).
check_beta
checks if defines a
valid distribution, e.g., for normal distribution
'sigma'
must be
positive.
estimate_beta
estimates for a given
using MLE or methods of moments. Closed form solutions
are used if they exist; otherwise the MLE is obtained numerically using
fitdistr
.
get_beta_names
returns (typical) names for each component of
.
Depending on the distribution
has different length and names: e.g.,
for a
"normal"
distribution beta
is of length
(
"mu"
, "sigma"
); for an "exp"
onential
distribution beta
is a scalar (rate "lambda"
).
Usage
beta2tau(beta, distname, use.mean.variance = TRUE)
check_beta(beta, distname)
estimate_beta(x, distname)
get_beta_names(distname)
Arguments
beta |
numeric; vector |
distname |
character; name of input distribution; see
|
use.mean.variance |
logical; if |
x |
a numeric vector of real values (the input data). |
Details
estimate_beta
does not do any data transformation as part of the
Lambert W F input/output framework. For an initial estimate
of
for Lambert W
F distributions see
get_initial_theta
and get_initial_tau
.
A quick initial estimate of is obtained by first finding the
(approximate) input
by
IGMM
, and then getting the MLE of
for this input data
(usually using
fitdistr
).
Value
beta2tau
returns a numeric vector, which is implied by
beta
and distname
.
check_beta
throws an error if is not
appropriate for the given distribution; e.g., if it has too many values
or if they are not within proper bounds (e.g.,
beta['sigma']
of a
"normal"
distribution must be positive).
estimate_beta
returns a named vector with estimates for
given
x
.
get_beta_names
returns a vector of characters.
See Also
Examples
# By default: delta = gamma = 0 and alpha = 1
beta2tau(c(1, 1), distname = "normal")
## Not run:
beta2tau(c(1, 4, 1), distname = "t")
## End(Not run)
beta2tau(c(1, 4, 1), distname = "t", use.mean.variance = FALSE)
beta2tau(c(1, 4, 3), distname = "t") # no problem
## Not run:
check_beta(beta = c(1, 1, -1), distname = "normal")
## End(Not run)
set.seed(124)
xx <- rnorm(100)^2
estimate_beta(xx, "exp")
estimate_beta(xx, "chisq")