| meow | R Documentation |
meow() is the core function of this simulation framework. It exists to help
users compare efficiency tradeoffs across different item selection algorithms,
parameter update algorithms, and data generating processes. It takes as
arguments an item selection function, a parameter update function, and a data
loader function and uses these to carry out a simulation of a full CAT
administration. Default behavior is to proceed until no further items are
administered. Because the internal simulation logic stops as soon as an
iteration administers no new items, early stopping conditions should be
implemented within the item selection function (by declining to administer
further items).
meow(
select_fun,
update_fun,
data_loader,
select_args = list(),
update_args = list(),
data_args = list(),
init = NULL,
fix = "none",
keep_adj_mats = TRUE
)
select_fun |
A function that specifies the item selection algorithm. |
update_fun |
A function that specifies the parameter update algorithm. |
data_loader |
A function that specifies the data generating process. |
select_args |
A named list of arguments to be passed to |
update_args |
A named list of arguments to be passed to |
data_args |
A named list of arguments to be passed to |
init |
A list of initialization values for estimated person and item
parameters. Accepts a named list with two entries, |
fix |
Which estimated parameters to treat as fixed at their true values.
One of |
keep_adj_mats |
Logical; if |
For speed, meow() represents responses with matrices rather than long data
frames. Two matrices, each with one row per respondent and one column per
item, are passed to the user-supplied modules:
R — the (potential) response of every respondent to every item. This is
produced once from the long resp data frame returned by the data loader.
admin — an integer administration matrix. An entry of 0 means the item
has not been administered to that respondent; a positive entry means it has,
and the value encodes the order of administration. Use admin != 0 (or
meow_administered()) as an administered mask.
Person and item parameters are kept as data frames (pers and item), each
with an identifier column (id and item, respectively) followed by one
column per parameter, so that users retain the flexibility to add arbitrary
parameters.
An item selection function receives pers, item, R, admin, and
adj_mat (plus any select_args) and returns an administration matrix with
newly selected cells marked non-zero. The harness stamps the order of
administration, so a function need only set newly selected cells to a positive
value (or TRUE) while leaving previously administered cells unchanged.
A parameter update function receives pers, item, R, and admin
(plus any update_args) and returns a list with updated pers and item
data frames.
Module authors who prefer long data frames can convert with meow_long().
A list of four named entities. results is a data frame with one row
per iteration of the simulation. It contains an iter column for the
iteration number and two columns per person and item parameter, one for the
estimated parameter and one for the bias in that estimate. adj_mats is a
list of item-item adjacency matrices, one per iteration (or, when
keep_adj_mats = FALSE, a single-element list with the final matrix); edge
weights count the number of respondents administered each pair of items.
pers_tru and item_tru are the true person and item parameter data
frames.
sim <- meow(
select_fun = select_max_info,
update_fun = update_theta_mle,
data_loader = data_simple_1pl,
data_args = list(N_persons = 20, N_items = 15),
fix = "item"
)
head(sim$results)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.