LMOMNPP_MCMC1 function

MCMC Sampling for Linear Regression Model of multiple historical data using Ordered Normalized Power Prior

MCMC Sampling for Linear Regression Model of multiple historical data using Ordered Normalized Power Prior

Multiple historical data are incorporated together. Conduct posterior sampling for Linear Regression Model with ordered normalized power prior. For the power parameter γ\gamma, a Metropolis-Hastings algorithm with independence proposal is used. For the model parameters (β,σ2)(\beta, \sigma^2), Gibbs sampling is used.

LMOMNPP_MCMC1(D0, X, Y, a0, b, mu0, R, gamma_ini, prior_gamma, gamma_ind_prop, nsample, burnin, thin, adjust)

Arguments

  • D0: a list of kk elements representing kk historical data, where the ithi^{th} element corresponds to the ithi^{th} historical data named as ``D0i''.
  • X: a vector or matrix or data frame of covariate observed in the current data. If more than 1 covariate available, the number of rows is equal to the number of observations.
  • Y: a vector of individual level of the response y in the current data.
  • a0: a positive shape parameter for inverse-gamma prior on model parameter σ2\sigma^2.
  • b: a positive scale parameter for inverse-gamma prior on model parameter σ2\sigma^2.
  • mu0: a vector of the mean for prior βσ2\beta|\sigma^2.
  • R: a inverse matrix of the covariance matrix for prior βσ2\beta|\sigma^2.
  • gamma_ini: the initial value of γ\gamma in MCMC sampling.
  • prior_gamma: a vector of the hyperparameters in the prior distribution Dirichlet(α1,α2,...,αK)Dirichlet(\alpha_1, \alpha_2, ... ,\alpha_K) for γ\gamma.
  • gamma_ind_prop: a vector of the hyperparameters in the proposal distribution Dirichlet(α1,α2,...,αK)Dirichlet(\alpha_1, \alpha_2, ... ,\alpha_K) for γ\gamma.
  • nsample: specifies the number of posterior samples in the output.
  • burnin: the number of burn-ins. The output will only show MCMC samples after bunrin.
  • thin: the thinning parameter in MCMC sampling.
  • adjust: Whether or not to adjust the parameters of the proposal distribution.

Details

The outputs include posteriors of the model parameters and power parameter, acceptance rate in sampling γ\gamma. Let θ\theta=(β,σ2)(\beta, \sigma^2), the normalized power prior distribution is

π0(γ)π0(θ)k=1KL(θD0k)(i=1kγi)π0(θ)k=1KL(θD0k)(i=1kγi)dθ. \frac{\pi_0(\gamma)\pi_0(\theta)\prod_{k=1}^{K}L(\theta|D_{0k})^(\sum_{i=1}^{k}\gamma_i)}{\int \pi_0(\theta)\prod_{k=1}^{K}L(\theta|D_{0k})^(\sum_{i=1}^{k}\gamma_i)\,d\theta}.

Here π0(γ)\pi_0(\gamma) and π0(θ)\pi_0(\theta) are the initial prior distributions of γ\gamma and θ\theta, respectively. L(θD0k)L(\theta|D_{0k}) is the likelihood function of historical data D0kD_{0k}, and i=1kγi\sum_{i=1}^{k}\gamma_i is the corresponding power parameter.

Returns

A list of class "NPP" with four elements: - acceptrate: the acceptance rate in MCMC sampling for γ\gamma using Metropolis-Hastings algorithm.

  • beta: posterior of the model parameter β\beta in vector or matrix form.

  • sigma: posterior of the model parameter σ2\sigma^2.

  • delta: posterior of the power parameter δ\delta.

Examples

## Not run: set.seed(1234) sigsq0 = 1 n01 = 100 theta01 = c(0, 1, 1) X01 = cbind(1, rnorm(n01, mean=0, sd=1), runif(n01, min=-1, max=1)) Y01 = X01%*%as.vector(theta01) + rnorm(n01, mean=0, sd=sqrt(sigsq0)) D01 = cbind(X01, Y01) n02 = 70 theta02 = c(0, 2, 3) X02 = cbind(1, rnorm(n02, mean=0, sd=1), runif(n02, min=-1, max=1)) Y02 = X02%*%as.vector(theta02) + rnorm(n02, mean=0, sd=sqrt(sigsq0)) D02 = cbind(X02, Y02) n03 = 50 theta03 = c(0, 3, 5) X03 = cbind(1, rnorm(n03, mean=0, sd=1), runif(n03, min=-1, max=1)) Y03 = X03%*%as.vector(theta03) + rnorm(n03, mean=0, sd=sqrt(sigsq0)) D03 = cbind(X03, Y03) D0 = list(D01, D02, D03) n0 = c(n01, n02, n03) n = 100 theta = c(0, 3, 5) X = cbind(1, rnorm(n, mean=0, sd=1), runif(n, min=-1, max=1)) Y = X%*%as.vector(theta) + rnorm(n, mean=0, sd=sqrt(sigsq0)) LMOMNPP_MCMC1(D0=D0, X=X, Y=Y, a0=2, b=2, mu0=c(0,0,0), R=diag(c(1/64,1/64,1/64)), gamma_ini=NULL, prior_gamma=rep(1/4,4), gamma_ind_prop=rep(1/4,4), nsample=5000, burnin=1000, thin=5, adjust=FALSE) ## End(Not run)

Author(s)

Qiang Zhang zqzjf0408@163.com

References

Ibrahim, J.G., Chen, M.-H., Gwon, Y. and Chen, F. (2015). The Power Prior: Theory and Applications. Statistics in Medicine 34:3724-3749.

Duan, Y., Ye, K. and Smith, E.P. (2006). Evaluating Water Quality: Using Power Priors to Incorporate Historical Information. Environmetrics 17:95-106.

See Also

LMMNPP_MCMC1; LMMNPP_MCMC2; LMOMNPP_MCMC2

  • Maintainer: Zifei Han
  • License: GPL (>= 2)
  • Last published: 2023-12-12

Useful links