Learn R Programming

ramidst (version 0.1.0)

dynamic_importance_sampling: Runs belief update from a piece of dynamic evidence over a dynamic Bayesian network

Description

Runs belief update from a piece of dynamic evidence over a dynamic Bayesian network

Usage

dynamic_importance_sampling(dyn_network, target_variable, dyn_evidence, sample_size = 50)

Arguments

dyn_network
a java object of class DynamicBayesianNetwork over which the computations will be carried out
target_variable
the name of the variable over which the posterior distribution will be computed
dyn_evidence
the observations over the dynamic Bayesian network.
sample_size
the size of the sample used to estimate the posterior distribution.

Value

a data.frame with the posterior distribution over the target variable on the different time slices.

Examples

Run this code
network <- dbn_generator(1,2,2)
print_amidst_bn(network)
stream <- generate_stream_from_dbn(network,1,10,"ClassVar")
resultsIS <- dynamic_importance_sampling(network,"ClassVar",stream)
plot(resultsIS[,2],type="l",ylim = c(0,1),col="red",xlab="Time slice",ylab="Prob. ClassVar = 1")

Run the code above in your browser using DataLab