binary {sparseMVN} | R Documentation |
Binary choice example
Description
Functions for binary choice example in the vignette.
Usage
binary.f(P, data, priors, order.row = FALSE)
binary.grad(P, data, priors, order.row = FALSE)
binary.hess(P, data, priors, order.row = FALSE)
binary.sim(N, k, T)
Arguments
P |
Numeric vector of length |
data |
Named list of data matrices Y and X, and choice count integer T |
priors |
Named list of matrices inv.Omega and inv.A. |
order.row |
Determines order of heterogeneous coefficients in parameter vector. If TRUE, heterogeneous coefficients are ordered by unit. If FALSE, they are ordered by covariate. |
N |
Number of heterogeneous units |
k |
Number of heterogeneous parameters |
T |
Observations per household |
Details
These functions are used by the heterogeneous binary choice example in the vignette. There are N heterogeneous units, each making T binary choices. The choice probabilities depend on k covariates. binary.sim simulates a dataset suitable for running the example.
Value
For binary.f, binary.df and binary.hess, the log posterior density, gradient and Hessian, respectively. The Hessian is a dgCMatrix object. binary.sim returns a list with simulated Y and X, and the input T.