thetahat: Parameter Estimation for Common Distributions

Description Usage Arguments Details Value Note Author(s) References See Also Examples

Description

Functions to estimate the parameters of distributions used in the lcmix package by maximum likelihood estimation.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
thetahat.norm(x, w=1, aslist=TRUE)
thetahat.mvnorm(x, w=1, aslist=TRUE)
thetahat.pvii(x, w=1, aslist=TRUE, iter.max=LC_ITER_MAX, theta=NULL)
thetahat.mvpvii(x, w=1, aslist=TRUE, iter.max=LC_ITER_MAX, theta=NULL)
thetahat.weisd(x, w=1, aslist=TRUE, shape.guess=NULL)
thetahat.mvweisd(x, w=1, aslist=TRUE, shape.guess=NULL)
thetahat.gamma(x, w=1, aslist=TRUE, shape.guess=NULL)
thetahat.mvgamma(x, w=1, aslist=TRUE, shape.guess=NULL)
thetahat.exp(x, w=1, aslist=TRUE)
thetahat.mvexp(x, w=1, aslist=TRUE)

Arguments

x

for univariate, a numeric vector, with each element representing an observation; for multivariate, a numeric matrix or data frame, with each row representing an observation.

w

a numeric vector of non-negative values; weights to be applied to the elements (univariate) or rows (multivariate) of x in parameter estimation.

aslist

logical; if TRUE, estimated parameters will be returned as a named list.

iter.max

maximum iterations for the “internal” EM algorithm used in estimation of parameters for these distributions. If iter.max=0, then only a 1-step estimation will be carried out, which is sufficient inside an “external” EM algorithm such as used by mixmod and mdmixmod.

theta

optional list containing initial guesses for parameters. If not NULL, then for thetahat.pvii and thetahat.mvpvii the elements of theta should be named mean, scale, and shape.

shape.guess

optional initial guess at the shape parameter: a scalar for univariate, a vector of the appropriate length for multivariate.

Details

By default, estimation is unweighted. If weights are given, the length of the weights should generally be the same as the length of the data, that is, length(w) = length(x) (univariate) or length(w) = nrow(x) (multivariate). If weights are shorter than the data, they will be recycled. If longer than the data, weights will be truncated and a warning will be given.

If aslist is FALSE, parameters will be returned as a vector with named elements if possible. However, multivariate distributions generally have matrix parameters and using aslist=FALSE for these distributions may produce results which are difficult to interpret.

Value

A named list, a vector, or a matrix, depending on the distribution and options used, of estimated parameters.

Note

For distributions without closed-form MLEs, a method-of-moments approach is used to obtain initial parameter estimates and then numerical optimization of the likelihood function is performed using nlminb in package stats. See Lawless (1982) for issues in parameter estimation for the Weibull and gamma distributions.

For multivariate distributions other than the normal and PVII, the correlation matrix for the copula is estimated using the inference function for margins procedure of Joe and Xu (1996).

Author(s)

Daniel Dvorkin

References

Lawless, J.F. (1982) Statistical Models and Methods for Lifetime Data, John Wiley & Sons.

Joe, H. and Xu, J. (1996) The estimation method of inference functions for margins for multivariate models. Technical Report 166, University of British Columbia, Department of Statistics.

See Also

mvnorm, pvii, mvpvii, weisd, mvweisd, mvgamma, mvexp; nlminb, Normal, Weibull, Gamma, Exponential in package stats; fitdistr in package MASS which performs parameter estimation using different numerical optimization functions.

Examples

1
2
3
4
5
set.seed(123)
x <- rweisd(1000, 2, 3)
thetahat.weisd(x, aslist=FALSE)
#    shape    decay
# 2.015511 2.996586

lcmix documentation built on May 2, 2019, 6:49 p.m.