summary.cosimmr_output {cosimmr}R Documentation

Summarises the output created with cosimmr_ffvb

Description

Produces textual summaries and convergence diagnostics for an object created with cosimmr_ffvb. The different options are: 'quantiles' which produces credible intervals for the parameters, 'statistics' which produces means and standard deviations, and 'correlations' which produces correlations between the parameters.

Usage

## S3 method for class 'cosimmr_output'
summary(
  object,
  type = c("quantiles", "statistics", "correlations"),
  obs = 1,
  ...
)

Arguments

object

An object of class cosimmr_output produced by the function cosimmr_ffvb

type

The type of output required. At least none of quantiles', 'statistics', or 'correlations'.

obs

The observation to generate a summary for. Defaults to 1.

...

Not used

Details

The quantile output allows easy calculation of 95 per cent credible intervals of the posterior dietary proportions. The correlations allow the user to judge which sources are non-identifiable.

Value

A list containing the following components:

quantiles

The quantiles of each parameter from the posterior distribution

statistics

The means and standard deviations of each parameter

correlations

The posterior correlations between the parameters

Note that this object is reported silently so will be discarded unless the function is called with an object as in the example below.

Author(s)

Emma Govan <emmagovan@gmail.com> Andrew Parnell

See Also

See cosimmr_ffvbfor creating objects suitable for this function, and many more examples. See also cosimmr_load for creating cosimmr objects, plot.cosimmr_input for creating isospace plots, plot.cosimmr_output for plotting output.

Examples


# A simple example with 10 observations, 2 tracers and 4 sources

# The data
data(geese_data_day1)
cosimmr_1 <- with(
  geese_data_day1,
  cosimmr_load(
    formula = mixtures ~ 1,
    source_names = source_names,
    source_means = source_means,
    source_sds = source_sds,
    correction_means = correction_means,
    correction_sds = correction_sds,
    concentration_means = concentration_means
  )
)

# Plot
plot(cosimmr_1)


# FFVB run
cosimmr_1_out <- cosimmr_ffvb(cosimmr_1)

# Summarise
summary(cosimmr_1_out) # This outputs all the summaries
summary(cosimmr_1_out, type = "quantiles") # Just the diagnostics
# Store the output in an
ans <- summary(cosimmr_1_out,
  type = c("quantiles", "statistics")
)


[Package cosimmr version 1.0.12 Index]