Functions for binary choice example in the vignette.
binary.f(P, data, priors, order.row = FALSE)
binary.grad(P, data, priors, order.row = FALSE)
binary.hess(P, data, priors, order.row = FALSE)
Numeric vector of length \((N+1)k\). First \(Nk\) elements are heterogeneous coefficients. The remaining k elements are population parameters.
Named list of data matrices Y and X, and choice count integer T
Named list of matrices inv.Omega and inv.Sigma
Determines order of heterogeneous coefficients in parameter vector. If TRUE, heterogeneous coefficients are ordered by unit. If FALSE, they are ordered by covariate.
Log posterior density, gradient and Hessian. The Hessian is a dgCMatrix object.
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.