View source: R/strategy_multiattribute.R
strategy_to_Ab | R Documentation |
Transforms ordered item-type predictions to polytope definition.
This allows to use Monte-Carlo methods to compute the Bayes factor
if the number of item types is large (bf_binom
).
strategy_to_Ab(strategy)
strategy |
a decision strategy returned by |
Note: Only works for models without guessing predictions and without equality constraints (i.e., requires separate error probabilities per item type)
a list containing the matrix A
and the vector b
that define a polytope via A*x <= b
.
# strategy: A,B,B,A e2<e3<e4<e1<.50
strat <- list(
pattern = c(-1, 4, 3, -2),
c = .5, ordered = TRUE,
prior = c(1, 1)
)
pt <- strategy_to_Ab(strat)
pt
# compare results to encompassing BF method:
b <- list(
pattern = 1:4, c = 1,
ordered = FALSE, prior = c(1, 1)
)
k <- c(2, 20, 18, 0)
n <- rep(20, 4)
m1 <- strategy_postprob(k, n, list(strat, b))
log(m1[1] / m1[2])
bf_binom(k, n, pt$A, pt$b, log = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.