Learn R Programming

ramidst (version 0.1.0)

importance_sampling_from_stream: Runs Importance sampling evidence updating from an AMIDST data stream

Description

Runs Importance sampling evidence updating from an AMIDST data stream

Usage

importance_sampling_from_stream(network, target_variable, evidence_variables, input_stream, sample_size, parallel = T, seed = 3L)

Arguments

network
a java object of class BayesianNetwork over which the computations will be carried out
target_variable
a string representing the name of variable whose posterior distribution will be computed
evidence_variables
a vector with the names of the observed variables
input_stream
and AMIDST data stream
sample_size
the sample size to be used during the simulation
parallel
a boolean indicating whether or not the items in the sample will be generated in parallel (when allowed by the system)
seed
the seed for the genertion of random numbers

Value

a data.frame with the posterior distribution of the target variable for each item in the strea

References

A. Salmeron, D. Ramos-Lopez, H. Borchani, A.M. Martinez, A.R. Masegosa, A. Fernandez, H. Langseth, A.L. Madsen, T.D. Nielsen (2015) Parallel importance sampling in conditional linear Gaussian networks. CAEPIA'2015. Lecture Notes in Artificial Intelligence 9422, 36-46.

Examples

Run this code
network <- load_amidst_bn(system.file("extdata","WasteIncinerator.bn",
package="ramidst"))
sample_stream <- amidst_data_stream(system.file("extdata",
"WasteIncineratorSample.arff",package="ramidst"))
posterior <- importance_sampling_from_stream(network,"B",c("F","E"),
sample_stream,50L)
posterior
posterior <- importance_sampling_from_stream(network,"L",c("F","E"),
sample_stream,50L)
posterior

Run the code above in your browser using DataLab