calcNoisyAndTable | R Documentation |
Calculates the conditional probability table for a noisy-and distribution. This follows a logical model where all inputs must be true for the output to be true; however, some "noise" is allowed that produces random deviations from the pure logic. The noisy-min is a generalization in which all variables are ordered, and the weakest of the parent variables drives the conditional probabilities of the child variable.
calcNoisyAndTable(skillLevels, obsLevels = c("True", "False"),
bypass = rep(0, length(skillLevels)), noSlip=1,
thresholds = sapply(skillLevels, function(states) states[1]))
calcNoisyAndFrame(skillLevels, obsLevels = c("True", "False"),
bypass = rep(0, length(skillLevels)), noSlip=1,
thresholds = sapply(skillLevels, function(states) states[1]))
skillLevels |
A list of character vectors giving names of levels for each of the condition variables. |
obsLevels |
A character vector giving names of levels for the output variables from highest to lowest. As a special case, can also be a vector of integers. Its length should be 2, and the first value is considered to be logically equivalent to "true". |
noSlip |
A scalar value between 0 and 1. This represents the probability that the output will be true when all of the inputs are true (e.g., 1 - the probability that an examinee will make a careless error). |
bypass |
A vector of the same length as |
thresholds |
If the input variables have more than two states, values that are equal to or higher than this threshold are considered true. It is assumed that the states of the variables are ordered from highest to lowest. |
The noisy-and distribution assumes that both the input and output
variables are binary. Basically, the output should be true if all of
the inputs are true. Let S_k = 1
if the k
th input is
true, and let r_k
be the bypass
parameter corresponding
to the k
th input variable. (If the S_k
's represent a
skill, then r_k
represents the probability that an examinee who
lacks that skill will bypass the need for that skill in solving the
problem.) Then the probability of the true state for the output
variable will be:
\Pr(X=True|{\bf S}) = r_0 \prod_k r_k^{1-S_k},
where r_0
(the noSlip
parameter) is the probability that
the output will be true even when all of the inputs are true.
It is assumed that all variables are ordered from highest to lowest
state, so that the first state corresponds to "true" the others to
false. If the input variable has more than two states, then it can be
reduced to a binary variable by using the threshold
argument.
Any values which are equal to or higher than the threshold
for
that variable are assumed to be true. (In this case, higher means
closer to the the beginning of the list of possible values.)
The noisy-min is a generalization
For calcNoisyAndTable
, a matrix whose rows correspond configurations
of the parent variable states (skillLevels
) and whose columns
correspond to obsLevels
. Each row of the table is a
probability distribution, so the whole matrix is a conditional
probability table. The order of the parent rows is the same as is
produced by applying expand.grid
to skillLevels
.
For calcNoisyAndFrame
a data frame with additional columns
corresponding to the entries in skillLevels
giving the parent
value for each row.
This is related to the DINA and NIDA models, but uses a slightly
different parameterization. In particular, if the noSlip
parameter is omitted, it is a noisy input deterministic and-gate
(NIDA), and if the bypass
parameters are omitted, it is similar
to a deterministic input noisy and-gate (DINA), except is lacks a
guessing parameter.
Russell Almond
Almond, R.G., Mislevy, R.J., Steinberg, L.S., Yan, D. and Williamson, D.M. (2015) Bayesian Networks in Educational Assessment. Springer. Chapter 8.
Pearl, J. (1988) Probabilistic Reasoning in Intelligent Systems: Networks of Plausible Inference. Morgan Kaufmann.
Diez, F. J. (1993) Parameter adjustment in Bayes networks. The generalized noisy OR-gate. In Heckerman and Mamdani (eds) Uncertainty in Artificial Intelligence 93. Morgan Kaufmann. 99–105.
Srinivas, S. (1993) A generalization of the Noisy-Or model, the generalized noisy OR-gate. In Heckerman and Mamdani (eds) Uncertainty in Artificial Intelligence 93. Morgan Kaufmann. 208–215.
calcDSTable
, calcDNTable
,
calcDPCTable
, expand.grid
,
calcNoisyOrTable
## Logical and table
and <- calcNoisyAndFrame(list(c("True","False"),c("True","False")),
c("Right","Wrong"))
## DINA, logical-and except that is allows for a small chance of slipping.
dina <- calcNoisyAndFrame(list(c("True","False"),c("True","False")),
noSlip=.9)
##NIDA, logical-and except that inputs can randomly be bypassed
nida <- calcNoisyAndFrame(list(c("True","False"),c("True","False")),
bypass=c(.3,.4))
##Full Noisy And distribution
noisyAnd <- calcNoisyAndFrame(list(c("True","False"),c("True","False")),
noSlip=.9,bypass=c(.3,.4))
thresh <- calcNoisyAndFrame(list(c("H","M","L"),c("H","M","L")),
c("Right","Wrong"),
threshold=c("M","H"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.