Get posterior values

get_posterior(
  fit = NULL,
  data = NULL,
  param = c("all", "connectance", "preference", "plant.abund", "animal.abund",
    "int.prob", "link")
)

Arguments

fit

Fitted model (from fit_model())

data

Data list (from prepare_data())

param

character. Name of the parameter to retrieve the posterior samples.

Value

A data frame

Examples

if (FALSE) { # interactive()
data(web)
dt <- prepare_data(mat = web, sampl.eff = rep(20, nrow(web)))
fit <- fit_model(dt, refresh = 0)
get_posterior(fit, dt, param = "connectance")

int.prob <- get_posterior(fit, dt, param = "int.prob")
int.prob
int.prob |> tidybayes::mean_qi()  # mean edge probability

# all posteriors
get_posterior(fit, dt, param = "all")
}