dagum_flexfit: Fitting Dagum distribution via maximum likelihood

Description Usage Arguments Details References

View source: R/dagum_flexfit.R

Description

dagum_flexfit is used to fit a Dagum distribution to a strictly positive response variable. The scale parameter may be specified either as a function of covariates or as a constant estimated using the response variable alone. If the scale parameter is specified to be a function of covariates, the canonical log link function is used.

Usage

1
2
3
dagum_flexfit(formula, data = NULL, weights = NULL, subset = NULL,
  ownstart = NULL, key = TRUE, warnings = FALSE, warnings1 = FALSE,
  ...)

Arguments

formula

An object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted.

data

An optional data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model. If not found in data, the variables are taken from environment(formula), typically the environment from which gamma_flexfit is called.

weights

An optional vector of weights to be used in the fitting process. Should be NULL or a numeric vector.

subset

An optional vector specifying a subset of observations to be used in the fitting process.

ownstart

An optional list containing starting values for the maximum likelihood estimation procedure. If a model with an intercept has been specified, the list must be of the form ownstart = list(a = , p = , beta0 = , beta1 =, …); if a mode with no intercept has been specified the list must be of the form ownstart = list(a = , p = , beta1 = , …); if the rate parameter is not a function of covariates the list must be of the form ownstart = list(a = , b = , p = ). It is important that the list have as many elements as there are parameters in the model, and that these be supplied in the order set out above.

key

A logical parameter dictating whether a key is produced alongside the model’s output.

warnings

A logical parameter dictating whether warnings from the maximum likelihood estimation procedure are produced alongside the model’s output.

...

Additional arguments to be passed to the function optim within the maximum likelihood estimation procedure. Useful arguments include the gradient descent algorithm to be used and bounds on parameter values; see the stats package.

Details

This function uses the same parametrization of the Dagum distribution as is used in Kleiber and Kotz (2003). Starting values for the maximum likelihood estimation procedure are obtained by maximizing the likelihood function of the the Generalized Beta distribution of the Second kind (GB2) subject to the constraint q = 1. Withing the GB2’s likelihood estimation, starting values for parameters other than p are taken from the method of moments estimates of the parameters of the Fisk distribution. The probability probability density function is used is:

f(y) = apy^ap-1/[b^ap(1+(y/b)^a)^p+1]

b is a scale parameter, while a and p are shape parameters.

When the argument formula specifies a full model with an intercept, b takes the following form and is estimated via a three step (maximum likelihood, least squares, maximum likelihood) procedure:

b = exp(β0 + β1x1 + …. + βkxk)

When the formula argument specifies a model without an intercept, b takes the bellow form. Estimating a model without an intercept is not advised as the estimates are extremely unstable; in simulations and test with medical data, the maximum likelihood procedure often often did not converge. Users wanting to estimate a model without an intercept are advised to supply their own starting values.

b = exp(β1x1 + …. + βkxk)

When a null model is specified (formula = y ~ 0) b is not estimated as a function of covariates. The starting value for the maximum likelihood estimation procedure is obtained by calling the function weibull_scale.

References

Kleiber, Christian, and Samuel Kotz. Statistical Size Distributions In Economics And Actuarial Sciences. John Wiley & Sons, 2003. Print.


Shakeel95/bioFlex documentation built on March 3, 2020, 11:27 a.m.