jointSummarize {eDNAjoint}R Documentation

Summarize posterior distributions of model parameters.

Description

This function summarizes the posterior distributions of specified parameters from a model fit. Summary includes mean, sd, and specified quantiles, as well as effective sample size (n_eff) and Rhat for estimated parameters. See more examples in the Package Vignette.

Usage

jointSummarize(modelfit, par = "all", probs = c(0.025, 0.975), digits = 3)

Arguments

modelfit

An object of class stanfit.

par

A character vector of parameter names. The default is 'all'.

probs

A numeric vector of quantiles of interest. The default is c(0.025,0.975).

digits

An integer indicating the number of decimal places to round values in summary table. Default value is 3.

Value

A summary table of parameter estimates.

Note

Before fitting the model, this function checks to ensure that the function is possible given the inputs. These checks include:

If any of these checks fail, the function returns an error message.

Examples


data(greencrabData)

# Fit a model
modelfit <- jointModel(data = greencrabData, family = "negbin", q = TRUE,
                       multicore = FALSE)

# Create summary table of all parameters
jointSummarize(modelfit$model)

# Summarize just 'p10' parameter
jointSummarize(modelfit$model, par = "p10", probs = c(0.025, 0.975),
               digits = 3)



[Package eDNAjoint version 0.2 Index]