Updates the prior probability distribution over models given observed data, using Bayes' rule.
Details
Applies Bayes' rule: $$P(M|D) \propto P(D|M) \cdot P(M)$$
where P(D|M) is the likelihood of data D given model M, and P(M) is the prior.
Examples
# Create a model space
space <- model_space(
bs_model_uniform(),
bs_model_gaussian()
)
# Update with observed data
observed <- c(10, 20, 30, 40, 50)
updated <- bayesian_update(space, observed)
print(updated)
#> <bs_model_space>
#> Models: 2
#> 1. Uniform (prior: 0.5, posterior: 1)
#> 2. Gaussian (prior: 0.5, posterior: 0)