model <- make_model('X->Y')
data_long <- make_data(model, n = 4)
data_short <- collapse_data(data_long, model)
model <- update_model(model, data_long)
model <- update_model(model, data_short)
# It is possible to implement updating without data, in which
# case the posterior is a stan object that reflects the prior
update_model(model)
if (FALSE) {
# Censored data types illustrations
# Here we update less than we might because we are aware of filtered data
data <- data.frame(X=rep(0:1, 10), Y=rep(0:1,10))
uncensored <-
make_model("X->Y") |>
update_model(data) |>
query_model(te("X", "Y"), using = "posteriors")
censored <-
make_model("X->Y") |>
update_model(
data,
censored_types = c("X1Y0")) |>
query_model(te("X", "Y"), using = "posteriors")
# Censored data: We learn nothing because the data
# we see is the only data we could ever see
make_model("X->Y") |>
update_model(
data,
censored_types = c("X1Y0", "X0Y0", "X0Y1")) |>
query_model(te("X", "Y"), using = "posteriors")
}
Run the code above in your browser using DataLab