Type: | Package |
Title: | Bayesian Estimation of the Reduced Reparameterized Unified Model with Gibbs Sampling |
Version: | 0.2.1 |
Description: | Implementation of Gibbs sampling algorithm for Bayesian Estimation of the Reduced Reparameterized Unified Model ('rrum'), described by Culpepper and Hudson (2017) <doi:10.1177/0146621617707511>. |
URL: | https://tmsalab.github.io/rrum/, https://github.com/tmsalab/rrum |
BugReports: | https://github.com/tmsalab/rrum/issues |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
Depends: | R (≥ 4.1.0), simcdm (≥ 0.1.0) |
Imports: | Rcpp (≥ 1.0.11) |
LinkingTo: | Rcpp, RcppArmadillo (≥ 0.12.6.6.0), rgen, simcdm |
Suggests: | testthat, covr |
Encoding: | UTF-8 |
RoxygenNote: | 7.2.3 |
NeedsCompilation: | yes |
Packaged: | 2023-11-29 07:25:13 UTC; ronin |
Author: | Steven Andrew Culpepper
|
Maintainer: | James Joseph Balamuta <balamut2@illinois.edu> |
Repository: | CRAN |
Date/Publication: | 2023-11-29 07:40:02 UTC |
rrum: Bayesian Estimation of the Reduced Reparameterized Unified Model with Gibbs Sampling
Description
Implementation of Gibbs sampling algorithm for Bayesian Estimation of the Reduced Reparameterized Unified Model ('rrum'), described by Culpepper and Hudson (2017) doi: 10.1177/0146621617707511.
Details
Implemention of a Bayesian estimation for the reduced Reparameterized Unified Model (rRUM).
Author(s)
Maintainer: James Joseph Balamuta balamut2@illinois.edu (ORCID) [copyright holder]
Authors:
Steven Andrew Culpepper sculpepp@illinois.edu (ORCID) [copyright holder]
Aaron Hudson awhudson@uw.edu (ORCID) [copyright holder]
References
Culpepper, S. A. & Hudson, A. (In Press). An improved strategy for Bayesian estimation of the reduced reparameterized unified model. Applied Psychological Measurement.
Hudson, A., Culpepper, S. A., & Douglas, J. (2016, July). Bayesian estimation of the generalized NIDA model with Gibbs sampling. Paper presented at the annual International Meeting of the Psychometric Society, Asheville, North Carolina.
See Also
Useful links:
Report bugs at https://github.com/tmsalab/rrum/issues
Gibbs sampler to estimate the rRUM
Description
Obtains samples from posterior distributon for the reduced Reparametrized Unified Model (rRUM).
Usage
rrum(
Y,
Q,
chain_length = 10000L,
as = 1,
bs = 1,
ag = 1,
bg = 1,
delta0 = rep(1, 2^ncol(Q))
)
Arguments
Y |
A |
Q |
A |
chain_length |
A |
as |
A |
bs |
A |
ag |
A |
bg |
A |
delta0 |
A |
Value
A list
that contains
-
PISTAR
: Amatrix
where each column represents one draw from the posterior distribution of pistar. -
RSTAR
: AJ x K x chain_length
array
whereJ
reperesents the number of items, andK
represents the number of attributes. Each slice represents one draw from the posterior distribution ofrstar
. -
PI
: Amatrix
where each column reperesents one draw from the posterior distribution ofpi
. -
ALPHA
: AnN x K x chain_length
array
whereN
reperesents the number of individuals, andK
represents the number of attributes. Each slice represents one draw from the posterior distribution ofalpha
.
Author(s)
Steven Andrew Culpepper, Aaron Hudson, and James Joseph Balamuta
References
Culpepper, S. A. & Hudson, A. (In Press). An improved strategy for Bayesian estimation of the reduced reparameterized unified model. Applied Psychological Measurement.
Hudson, A., Culpepper, S. A., & Douglas, J. (2016, July). Bayesian estimation of the generalized NIDA model with Gibbs sampling. Paper presented at the annual International Meeting of the Psychometric Society, Asheville, North Carolina.
See Also
Examples
# Set seed for reproducibility
set.seed(217)
## Define Simulation Parameters
N = 1000 # Number of Individuals
J = 6 # Number of Items
K = 2 # Number of Attributes
# Matrix where rows represent attribute classes
As = attribute_classes(K)
# Latent Class probabilities
pis = c(.1, .2, .3, .4)
# Q Matrix
Q = rbind(c(1, 0),
c(0, 1),
c(1, 0),
c(0, 1),
c(1, 1),
c(1, 1)
)
# The probabiliies of answering each item correctly for individuals
# who do not lack any required attribute
pistar = rep(.9, J)
# Penalties for failing to have each of the required attributes
rstar = .5 * Q
# Randomized alpha profiles
alpha = As[sample(1:(K ^ 2), N, replace = TRUE, pis),]
# Simulate data
rrum_items = simcdm::sim_rrum_items(Q, rstar, pistar, alpha)
## Not run:
# Note: This portion of the code is computationally intensive.
# Recover simulation parameters with Gibbs Sampler
Gibbs.out = rrum(rrum_items, Q)
# Iterations to be discarded from chain as burnin
burnin = 1:5000
# Calculate summarizes of posterior distributions
rstar.mean = with(Gibbs.out, apply(RSTAR[,,-burnin], c(1, 2), mean))
pistar.mean = with(Gibbs.out, apply(PISTAR[,-burnin], 1, mean))
pis.mean = with(Gibbs.out, apply(PI[,-burnin], 1 ,mean))
## End(Not run)