draww_or1: Samples the latent weight w for ordinal quantile model with...

Description Usage Arguments Details Value References See Also Examples

View source: R/ORI.R

Description

This function samples the latent weight w from a generalized inverse-Gaussian distribution (GIG) for ordinal quantile model with more than 3 outcomes.

Usage

1
draww_or1(z, x, beta, tau2, theta, lambda)

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).

tau2

2/(p(1-p)).

theta

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

lambda

index parameter of GIG distribution which is equal to 0.5

Details

Function samples a vector of the latent weight w from a GIG distribution.

Value

column vector of w from a GIG distribution.

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

GIGrvg, Gibbs sampling, rgig

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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
set.seed(101)
z <- c(0.9812363, -1.09788, -0.9650175, 8.396556,
 1.39465, -0.8711435, -0.5836833, -2.792464,
 0.1540086, -2.590724, 0.06169976, -1.823058,
 0.06559151, 0.1612763, 0.161311, 4.908488,
 0.6512113, 0.1560708, -0.883636, -0.5531435)
x <- matrix(c(
     1, 1.4747905363, 0.167095186,
     1, -0.3817326861, 0.041879526,
     1, -0.1723095575, -1.414863777,
     1, 0.8266428137, 0.399722073,
     1, 0.0514888733, -0.105132425,
     1, -0.3159992662, -0.902003846,
     1, -0.4490888878, -0.070475600,
     1, -0.3671705251, -0.633396477,
     1, 1.7655601639, -0.702621934,
     1, -2.4543678120, -0.524068780,
     1,  0.3625025618,  0.698377504,
     1, -1.0339179063,  0.155746376,
     1,  1.2927374692, -0.155186911,
     1, -0.9125108094, -0.030513775,
     1,  0.8761233001,  0.988171587,
     1,  1.7379728231,  1.180760114,
     1,  0.7820635770, -0.338141095,
     1, -1.0212853209, -0.113765067,
     1,  0.6311364051, -0.061883874,
     1,  0.6756039688,  0.664490143),
     nrow = 20, ncol = 3, byrow = TRUE)
beta <- c(-1.583533, 1.407158, 2.259338)
tau2 <- 10.66667
theta <- 2.666667
lambda <- 0.5
output <- draww_or1(z, x, beta, tau2, theta, lambda)

# output
#   0.16135732
#   0.39333080
#   0.80187227
#   2.27442898
#   0.90358310
#   0.99886987
#   0.41515947 ... soon

bqror documentation built on Sept. 28, 2021, 5:07 p.m.

Related to draww_or1 in bqror...