Prior and Posterior Predictive

BayesFlux.sample_prior_predictiveFunction
sample_prior_predictive(bnn::BNN, predict::Function, n::Int = 1;

Samples from the prior predictive.

Arguments

  • bnn a BNN
  • predict a function taking a network and returning a vector of predictions
  • n number of samples

Optional Arguments

  • rng a RNG
BayesFlux.get_posterior_networksFunction
get_posterior_networks(bnn::BNN, ch::AbstractMatrix{T}) where {T}

Get the networks corresponding to posterior draws.

Arguments

  • bnn a BNN
  • ch A Matrix of draws (columns are θ)
BayesFlux.sample_posterior_predictFunction
sample_posterior_predict(bnn::BNN, ch::AbstractMatrix{T}; x = bnn.x)

Sample from the posterior predictive distribution.

Arguments

  • bnn: a Bayesian Neural Network
  • ch: draws from the posterior. These should be either obtained using mcmc or bbb
  • x: explanatory variables. Default is to use the training data.