postGamma {skipTrack} | R Documentation |
Perform a Metropolis-Hastings Step for Drawing a New Gamma
Description
Our model assumes that tau_i ~ Gamma(alpha_i, phi) where alpha_i/phi = theta_i and g(theta_i) = Z_i^T Gamma, where g is the log-link function. Because of this GLM formulation we cannot simply draw from a posterior here and instead use a Metropolis-Hastings step with proposal distribution propGamma ~ MVNormal(currentGamma, rhoGamma*I)
Usage
postGamma(taui, Zi, currentGamma, phi = 1, rhoGamma = 1000)
Arguments
taui |
A vector of length num_Individuals representing precision parameters for individuals. |
Zi |
A matrix of covariates, where each row represents an individual and each column represents a covariate. |
currentGamma |
A vector (or matrix with 1 row) representing the current Gamma value. |
phi |
A scalar, the prior rate for tau_i. |
rhoGamma |
A scalar representing the proposal distribution precision parameter. |
Details
This draw step assumes a log-link function for the Gamma GLM that we are fitting.
Value
A list containing the new Gamma value and the corresponding thetai values.