RegressionGadget | R Documentation |
These functions open a shiny application (in a browser window or other
location) for editing a Pnode
object. To reduce the
complexity, the display assumes that PnodeLink(pnode)
is
partialCredit
or
gradedResponse
, and that
PnodeLink(pnode)
is Compensatory
(Conjunctive
or Disjunctive
are also possibilities, but
usually, the OffsetGadget
is a better parameterization
for these rules).
MakeRegressionGadget(pnode, useR2 = PnodeNumParents(pnode) > 0L,
color = "sienna")
RegressionGadget(pnode, useR2 = PnodeNumParents(pnode) > 0L,
color="sienna",viewer=shiny::paneViewer())
pnode |
A |
color |
A base color to use for barcharts (see
|
useR2 |
A logical value. If true, the link scale parameter is
convered to an |
viewer |
This is passed to the |
The RegressionGadget
assumes that:
The link function is normalLink
.
There is a single rule for all states, and that rule is
Compensatory
.
There is no inner Q-matrix, i.e., PnodeQ(pnode)=TRUE
.
There is a single beta value.
That PnodeLinkScale(pnode)
has a positive value.
This model is essentially a latent regression of the effective thetas
onto the latent theta of the child space. The link scale parameter
gives the residual variance (see normalLink
).
An alternative parameterization, often more familiar to experts, uses
the multiple R^2
instead of the residual variance. The
useR2
flag determines how the link scale parameter is conveyed
on the gadget.
The function MakeRegressionGadget
returns a list of two
functions, ui
and server
. These are meant to be passed
to shiny::runApp
to generate the actual app.
The function RegressionGadget
will return the pnode
object or throw a ‘Cancel-Error’.
Russell Almond
Almond, R. G. (2015) An IRT-based Parameterization for Conditional Probability Tables. Paper presented at the 2015 Bayesian Application Workshop at the Uncertainty in Artificial Intelligence Conference.
Pnode
, calcDPCFrame
,
barchart.CPF
OffsetGadget
, CompensatoryGadget
,
DPCGadget
## Not run:
library(PNetica) ## Requires implementation
sess <- NeticaSession()
startSession(sess)
tNet <- CreateNetwork("TestNet",sess)
theta1 <- NewDiscreteNode(tNet,"theta1",
c("VH","High","Mid","Low","VL"))
PnodeStateValues(theta1) <- effectiveThetas(PnodeNumStates(theta1))
PnodeProbs(theta1) <- rep(1/PnodeNumStates(theta1),PnodeNumStates(theta1))
theta2 <- NewDiscreteNode(tNet,"theta2",
c("VH","High","Mid","Low","VL"))
PnodeStateValues(theta2) <- effectiveThetas(PnodeNumStates(theta2))
PnodeProbs(theta2) <- rep(1/PnodeNumStates(theta1),PnodeNumStates(theta2))
## RegressionGadget
partial3 <- NewDiscreteNode(tNet,"partial3",
c("FullCredit","PartialCredit","NoCredit"))
PnodeParents(partial3) <- list(theta1,theta2)
## Usual way to set rules is in constructor
partial3 <- Pnode(partial3,rules="Compensatory", link="normalLink")
PnodePriorWeight(partial3) <- 10
PnodeLinkScale(partial3) <- 1.0
BuildTable(partial3)
partial3 <- RegressionGadget(partial3)
partial3 <- RegressionGadget(partial3,useR2=FALSE)
## This expression can be used inside an Rmarkdown document
gadget <- MakeRegressionGadget(partial3)
shinyApp(gadget$ui,gadget$server,options(height=2000))
## No parent case
theta2 <- Pnode(theta2,link="normalLink",linkScale=1)
theta2 <- RegressionGadget(theta2)
DeleteNetwork(tNet)
stopSession(sess)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.