gb2_flexprob: Conditional probability for Generalized Beta distribution of...

Description Usage Arguments Details References

View source: R/gb2_prob.R

Description

gb2_flexprob returns the conditional probability P(Y<k | X) of a model fitted via the function gb2_flexfit; where b has been specified to be a function of covariates the required value should be specified using the ‘features’ parameter. The function includes a procedure for visualizing the conditional probability. gb2_flexprob also allows for the correlation of estimated parameters via the Cholesky decomposition of the variance-covariance matrix.

Usage

1
gb2_flexprob(K, model, features, visualise = TRUE, xlim, draws = 5)

Arguments

K

Value for which P(Y<k | X) is computed.

model

An object of class "mle2" produced using the function gb2_flexfit.

features

A numeric vector specifying the value of covriates at which the conditional probability should be evaluated; the covariates in the vector should appear in the same order as they do in the model. Where a model does not depend on covariates the argument may be left blank.

visualise

Logical. If TRUE (the default) the conditional distribution is plotted at P(Y<k | x) is shaded.

xlim

Numeric vectors of length 2, giving the coordinate range of the dependent variable.

draws

The number of random draws from multivariate random normal representing correlated parameters. If parameter correlation is not required draws should be set to zero.

Details

This function uses the same parametrization of the Generalized Beta Distribution of the Second Kind as is used in Kleiber and Kotz (2003). The probability probability density function is used is:

f(y) = ay^ap-1/[b^apΒ(p,q)(1+(y/b)^a)^p+q]

The function returns:

P(Y>k | X) = [(k/b)^a/(1+(k/n)^a)]^p/(pΒ(p,q))⋅2F1(p,1-q;p+1;[(k/b)^a/(1+(k/b)^a)])

b may be a function of covariates; in which case, the cannonical log link function is used.

References

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


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