summary.magioutput: Summary of parameter estimates from 'magioutput' object

View source: R/magi-package.R

summary.magioutputR Documentation

Summary of parameter estimates from magioutput object

Description

Computes a summary table of parameter estimates from the output of MagiSolver

Usage

## S3 method for class 'magioutput'
summary(
  object,
  sigma = FALSE,
  par.names,
  est = "mean",
  lower = 0.025,
  upper = 0.975,
  digits = 3,
  ...
)

Arguments

object

a magioutput object.

sigma

logical; if true, the noise levels \sigma will be included in the summary.

par.names

vector of parameter names for the summary table. If provided, should be the same length as the number of parameters in \theta, or the combined length of \theta and \sigma when sigma = TRUE.

est

string specifying the posterior quantity to treat as the estimate. Default is est = "mean", which treats the posterior mean as the estimate. Alternatives are the posterior median (est = "median", taken component-wise) and the posterior mode (est = "mode", approximated by the MCMC sample with the highest log-posterior value).

lower

the lower quantile of the credible interval, default is 0.025.

upper

the upper quantile of the credible interval, default is 0.975.

digits

integer; the number of significant digits to print.

...

additional arguments affecting the summary produced.

Details

Computes parameter estimates and credible intervals from the MCMC samples. By default, the posterior mean is treated as the parameter estimate, and lower = 0.025 and upper = 0.975 produces a central 95% credible interval.

Value

Returns a matrix where rows display the estimate, lower credible limit, and upper credible limit of each parameter.

Examples

# Set up odeModel list for the Fitzhugh-Nagumo equations
fnmodel <- list(
  fOde = fnmodelODE,
  fOdeDx = fnmodelDx,
  fOdeDtheta = fnmodelDtheta,
  thetaLowerBound = c(0, 0, 0),
  thetaUpperBound = c(Inf, Inf, Inf)
)

# Example FN data
data(FNdat)

# Create magioutput from a short MagiSolver run (demo only, more iterations needed for convergence)
result <- MagiSolver(FNdat, fnmodel, control = list(nstepsHmc = 5, niterHmc = 100)) 

summary(result, sigma = TRUE, par.names = c("a", "b", "c", "sigmaV", "sigmaR"))

magi documentation built on April 26, 2023, 1:12 a.m.