| predict.blim | R Documentation |
Predict knowledge state or state probabilities based on a fitted blim
object given a response pattern.
## S3 method for class 'blim'
predict(object, newdata = NULL, type = c("state", "probs"),
method = c("ML", "MD", "MDML"), quiet = FALSE,
ties.method = c("min", "max", "random"), i.RK = NULL,
incradius = object$incradius, as.pattern = TRUE, ...)
object |
an object of class |
newdata |
a character vector of response patterns with which to predict. |
type |
for each pattern, predict a knowledge state or the state probabilities. |
method |
how to compute the posterior state probabilities. (See Details.) |
quiet |
silence message when estimation and prediction methods differ. |
ties.method |
how to deal with a posteriori equally probable states. |
i.RK |
optional indicator matrix of states at minimum distance from response patterns. |
incradius |
see |
as.pattern |
return a character vector via |
... |
further arguments passed to |
Predicted is the modal posterior state (type = "state") or the
posterior distribution (type = "probs") of knowledge states given a
response pattern. Depending on the method argument, the posterior
distribution is defined as:
Maximum likelihood (method = "ML")
P(K | R)_{ML} =
\frac{P(R | K) P(K)}{\sum_K P(R | K) P(K)} =
\frac{P(R | K) P(K)}{P(R)}
Minimum discrepancy (method = "MD")
P(K | R)_{MD} =
\frac{i_{RK}}{\sum_K i_{RK}}
Minimum discrepancy ML (method = "MDML")
P(K | R)_{MDML} =
\frac{i_{RK} \cdot P(K | R)_{ML}}
{\sum_K i_{RK} \cdot P(K | R)_{ML}}
where i_{RK} is a pattern-by-state indicator matrix that is one
for each state K that is at minimum distance from pattern R.
If type = "state", a character vector of knowledge states (if
as.pattern = TRUE) or a state-by-problem indicator matrix (if
as.pattern = FALSE).
If type = "probs", a matrix of posterior state probabilities.
blim, slm.
data(DoignonFalmagne7)
m <- blim(DoignonFalmagne7$K, DoignonFalmagne7$N.R)
predict(m)
predict(m, newdata = c("00100", "10100", "01111"), as.pattern = FALSE)
m <- slm(DoignonFalmagne7$K, DoignonFalmagne7$N.R)
predict(m, newdata = "00100")
data(endm)
m <- blim(endm$K, endm$N.R)
predict(m, type = "probs", method = "MD")
cbind(
observed = names(m$N.R),
min = predict(m, method = "MD", ties.method = "min"),
max = predict(m, method = "MD", ties.method = "max"),
rnd = predict(m, method = "MD", ties.method = "random")
) |> print(quote = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.