cpef2reg: Parameter Estimation of (Zero-Truncated) Poisson Regression...

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

View source: R/cpef2reg.R

Description

The function cpef2reg estimates regression parameters of (zero-truncated) Poisson regression model with multivariate normal prior distributions. See ‘Details’.

Usage

1
2
3
4
  cpef2reg(y, X, ztrunc = FALSE,
    method = c("MH", "IS", "LA", "LAF"), xi, b, B,
    apriori = c("normal"), start, verbose = FALSE,
    initrun = FALSE, control = list(), proposal = list())

Arguments

y

a numeric vector of length n.

X

a model matrix of size n-by-p.

b

a mean vector of length p for apriori.

B

a variance-covariance matrix of size p-by-p for apriori.

ztrunc

a logical value; Defults to FALSE; Is the zero truncated?

method

a name of numerical method to be used for fitting the formula in the model. Three options of MH, LA, and IS are available. See ‘Details’ for more information.

xi

a numeric vector of length p for prediction.

verbose

a logical value; Be more verbose about the process by displaying messages; Defaults to FALSE.

initrun

a logical value; Would you like to run the function cpef for other numerical method in order to have the best guess about start?

control

a list of parameters for controlling the fitting process. See ‘Details’.

proposal

a list of parameters for controlling the fitting process. See ‘Details’.

start

a list of parameters for controlling the fitting process. See ‘Details’.

Details

Numericall methods are implemented for both cases of ztrunc=TRUE and ztrunc=FALSE.

LA (Laplace approximation) is the implementation of that in the study Tierney, Kass, and Kadane 1989. The correction const defaults to 2e1 (log-scaled value).

MH (Metropolis-Hasting algorithm) is the implementation of that in the study Chib and Greenberg 1995. nchains and nburns defaults to 2e3 and 5e2. Normal distribution with mu=log(mean(y)) and sigma=sd(y) is chosen for a proposal distribution to generate a candidate sample.

IS (Importance sampling) is the implementation of that in the study Denny 2001. ess (effective sample size) is computed with an importance sample of size n=1e3. cpef is recursively used with method=LA for having the best guess for a mean value mu of a proposal distribution.

Value

The list of components returned from cpef2reg depends on what numerical method is employed. All input paramters are inherited. The commonly returned components are:

theta

The estimated canonical parameter of length p.

ess

The effective sample size if method=IS.

sratio

The ratio of determinants of two hessian matrices if method=LA

accept.rate

The proportion of candidate samples that are accepted in the chain of length n=2e3 if method=MH.

Note

Estimation with method=AQ frequently fails on the cases of ztrunc=FALSE and ztrunc=TRUE if n<50.

Estimation with method=LA frequently fails on the case of ztrunc=TRUE if n<5e2.

method=MH is the most safe choice for various conditions.

Author(s)

Chel Hee Lee <gnustats@gmail.com>

References

Tierney L., Kass R. and Kadane J. (1989). “Fully Exponential Laplace Approximations to Expectations and Variances of Nonpositive Functions.” _Journal of the American Statistical Association_, *84*(407), pp. 710-716.

Chib S. and Greenberg E. (1995). “Understanding the Metropolis-Hastings Algorithm.” _The American Statistician_, *49*(4), pp. 327-335.

Denny M. (2001). “Introduction to importance sampling in rare-event simulations.” _European Journal of Physics_, *22*(4), pp. 403.

Lee (2013) “Imprecise inferential framework”, PhD thesis.

See Also

optim, integrate, update, model, iprior

Examples

1
2
3
4
## Not run: 
# cpef2reg

## End(Not run)

ipeglim documentation built on May 2, 2019, 4:31 p.m.