sufficient_statistics {RprobitB} | R Documentation |
Compute sufficient statistics
Description
This function computes sufficient statistics from an RprobitB_data
object for the Gibbs sampler to save computation time.
Usage
sufficient_statistics(data, normalization)
Arguments
data |
An object of class |
normalization |
An object of class |
Value
A list of sufficient statistics on the data for Gibbs sampling, containing
the elements
N
,T
,J
,P_f
andP_r
fromdata
,-
Tvec
, the vector of choice occasions for each decider of lengthN
, -
csTvec
, a vector of lengthN
with the cumulated sums ofTvec
starting from0
, -
W
, a list of design matrices differenced with respect to alternative numbernormalization$level$level
for each decider in each choice occasion with covariates that are linked to a fixed coefficient (orNA
ifP_f = 0
), -
X
, a list of design matrices differenced with respect to alternative numbernormalization$level$level
for each decider in each choice occasion with covariates that are linked to a random coefficient (orNA
ifP_r = 0
), -
y
, a matrix of dimensionN
xmax(Tvec)
with the observed choices of deciders in rows and choice occasions in columns, decoded to numeric values with respect to their appearance indata$alternatives
, where rows are filled withNA
in case of an unbalanced panel, -
WkW
, a matrix of dimensionP_f^2
x(J-1)^2
, the sum over Kronecker products of each transposed element inW
with itself, -
XkX
, a list of lengthN
, each element is constructed in the same way asWkW
but with the elements inX
and separately for each decider, -
rdiff
(for the ranked case only), a list of matrices that reverse the base differencing and instead difference in such a way that the resulting utility vector is negative.