drawnu_or2: Samples the scale factor nu for ordinal quantile model with 3...

Description Usage Arguments Details Value References See Also Examples

View source: R/ORII.R

Description

This function samples the ν from a generalized inverse Gaussian (GIG) distribution for ordinal quantile model with 3 outcomes.

Usage

1
drawnu_or2(z, x, beta, sigma, 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).

sigma

scale factor, a scalar.

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 the ν from a GIG distribution.

Value

Returns a row vector of the ν from GIG distribution.

References

Rahman, M. A. (2016), “Bayesian Quantile Regression for Ordinal Models.” Bayesian Analysis, 11(1), 1-24. DOI: 10.1214/15-BA939

Devroye, L. (2014). “Random variate generation for the generalized inverse Gaussian distribution.” Statistics and Computing, 24(2): 239–246. DOI: 10.1007/s11222-012-9367-z

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
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)
sigma <- 3.749524
tau2 <- 10.6667
theta <- 2.6667
lambda <- 0.5
output <- drawnu_or2(z, x, beta, sigma, tau2, theta, lambda)

# output
#   5.177456 4.042261 8.950365
#   1.578122 6.968687 1.031987
#   4.13306 0.4681557 5.109653
#   0.1725333

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

Related to drawnu_or2 in bqror...