updateSM: Updates the Student model with additional evidence.

updateSMR Documentation

Updates the Student model with additional evidence.

Description

This function is the core of the EABN algorithm. It finds and attaches the evidence model to the student model, enters the findings from the evidence message, and then detaches the evidence model, leaving the student model updated.

Usage

updateSM(eng, rec, evidMess, debug = 0)

Arguments

eng

The BNEngine supervising the opeeration.

rec

The StudentRecord for the student in question.

evidMess

The EvidenceSet containing the new evidence.

debug

An integer describing how much debugging to do. If set to a number greater than 1, it will issue a call to recover at various stages to aid in debugging models.

Details

The update algorithm performs the following step:

  1. Finds the evidence model by name according to the context field of the EvidenceSet. See WarehouseSupply.

  2. Adjoins the sm of the student record with the evidence model and compiles the modified network. See PnetAdjoin and PnetCompile.

  3. Loops over the observables in the evidence set, if they correspond to nodes in the evidence model, then instantiate their values using PnodeEvidence.

  4. Detatch the evidence model and recompile the network. See PnetDetach.

Value

The updated student record is returned.

Author(s)

Russell Almond

References

Almond, Mislevy, Steinberg, Yan and Williamson (2015). Bayesian Networks in Educational Assessment. Springer. Especially Chapters 5 and 13.

See Also

Classes: BNEngine, PnetWarehouse, StudentRecord, EvidenceSet, Pnet

Functions in EABN: accumulateEvidence, updateHist, updateStats, getRecordForUser

Peanut Functions: WarehouseSupply, PnetAdjoin, PnetCompile, PnetDetach, PnodeEvidence

Examples


## Not run: 
## Requires Netica
library(PNetica)  ## Must load to setup Netica DLL
app <- "ecd://epls.coe.fsu.edu/EITest"
sess <- RNetica::NeticaSession()
RNetica::startSession(sess)

config.dir <- file.path(library(help="Peanut")$path, "auxdata")
net.dir <- file.path(library(help="PNetica")$path,"testnets")

netman <- read.csv(file.path(config.dir, "Mini-PP-Nets.csv"),
                    row.names=1, stringsAsFactors=FALSE)
stattab <- read.csv(file.path(config.dir, "Mini-PP-Statistics.csv"),
                    as.is=TRUE)

Nethouse <- PNetica::BNWarehouse(netman,session=sess,
             address=net.dir)

cl <- new("CaptureListener")
listeners <- list("cl"=cl)

ls <- ListenerSet(sender= paste("EAEngine[",app,"]"),
                  db=MongoDB(noMongo=TRUE), listeners=listeners)

eng <- newBNEngineNDB(app=app,warehouse=Nethouse,
                     listenerSet=ls,manifest=netman,
                     profModel="miniPP_CM",
                     histNodes="Physics",
                     statmat=stattab,
                     activeTest="EAActive.txt")

## Standard initialization methods.                     
loadManifest(eng,netman)
eng$setHistNodes("Physics")
configStats(eng,stattab)
setupDefaultSR(eng)

sr1 <- getRecordForUser(eng,"S1")
PnetCompile(sm(sr1))
eap1 <- PnodeEAP(sm(sr1),PnetFindNode(sm(sr1),"Physics"))

e1 <- EvidenceSet(uid="S1",app="Test",context="PPcompEM",
                  obs=list("CompensatoryObs"="Right"))

sr1a <- updateSM(eng,sr1,e1)
eap1a <- PnodeEAP(sm(sr1),PnetFindNode(sm(sr1),"Physics"))
## This should have changed.
stopifnot(abs(eap1-eap1a) > .001)


## End(Not run)


ralmond/EABN documentation built on Aug. 30, 2023, 12:52 p.m.