drawsigma_or2: Samples the sigma for ordinal quantile model with 3 outcomes

Description Usage Arguments Details Value References See Also Examples

View source: R/ORII.R

Description

This function samples the σ from an inverse-gamma distribution for ordinal quantile model with 3 outcomes.

Usage

1
drawsigma_or2(z, x, beta, nu, tau2, theta, n0, d0)

Arguments

z

Gibbs draw of latent response variable, a column vector.

x

covariate matrix of dimension (n x k) including a column of ones.

beta

Gibbs draw of coefficients of dimension (k x 1).

nu

modified scale factor, row vector.

tau2

2/(p(1-p)).

theta

(1-2p)/(p(1-p)).

n0

prior hyper-parameter for σ.

d0

prior hyper-parameter for σ.

Details

Function samples the σ from an inverse gamma distribution.

Value

Returns a list with components

References

Albert, J., and Chib, S. (1993). “Bayesian Analysis of Binary and Polychotomous Response Data.” Journal of the American Statistical Association, 88(422): 669–679. DOI: 10.1080/01621459.1993.10476321

Casella, G., and George, E. I. (1992). “Explaining the Gibbs Sampler.” The American Statistician, 46(3): 167-174. DOI: 10.1080/00031305.1992.10475878

Geman, S., and Geman, D. (1984). “Stochastic Relaxation, Gibbs Distributions, and the Bayesian Restoration of Images.” IEEE Transactions an Pattern Analysis and Machine Intelligence, 6(6): 721-741. DOI: 10.1109/TPAMI.1984.4767596

See Also

rgamma, Gibbs sampling

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
set.seed(101)
z <- c(21.01744, 33.54702, 33.09195, -3.677646,
 21.06553, 1.490476, 0.9618205, -6.743081, 21.02186, 0.6950479)
x <- matrix(c(
     1, -0.3010490, 0.8012506,
     1,  1.2764036, 0.4658184,
     1,  0.6595495, 1.7563655,
     1, -1.5024607, -0.8251381,
     1, -0.9733585, 0.2980610,
     1, -0.2869895, -1.0130274,
     1,  0.3101613, -1.6260663,
     1, -0.7736152, -1.4987616,
     1,  0.9961420, 1.2965952,
     1, -1.1372480, 1.7537353),
     nrow = 10, ncol = 3, byrow = TRUE)
beta <- c(-0.74441, 1.364846, 0.7159231)
nu <- c(5, 5, 5, 5, 5, 5, 5, 5, 5, 5)
tau2 <- 10.6667
theta <- 2.6667
n0 <- 5
d0 <- 8
output <- drawsigma_or2(z, x, beta, nu, tau2, theta, n0, d0)

# output$sigma
#   3.749524

bqror documentation built on Nov. 22, 2021, 1:07 a.m.

Related to drawsigma_or2 in bqror...