plot.cosimmr_output {cosimmr}R Documentation

Plot different features of an object created from cosimmr_ffvb.

Description

This function allows for 4 different types of plots of the simmr output created from cosimmr_ffvb. The types are: plot of beta values

Usage

## S3 method for class 'cosimmr_output'
plot(
  x,
  type = c("isospace", "beta_histogram", "beta_boxplot", "prop_histogram",
    "prop_density", "covariates_plot"),
  obs = 1,
  cov_name = NULL,
  binwidth = 0.05,
  alpha = 0.5,
  title = NULL,
  n_output = 3600,
  source = NULL,
  one_plot = FALSE,
  n_pred = 1000,
  ...
)

Arguments

x

An object of class cosimmr_output created via cosimmr_ffvb.

type

The type of plot required. Can be one or more of 'isospace', 'beta_histogram', 'beta_boxplot', 'prob_histogram', 'prob_density', 'covariates_plot'

obs

The observation number you wish to plot

cov_name

The name of the covariate you wish to plot (for beta and covariates plot)

binwidth

The width of the bins for the histogram. Defaults to 0.05

alpha

The degree of transparency of the plots. Not relevant for matrix plots

title

The title of the plot.

n_output

The number of theta samples you wish to plot with. Defaults to 3600

source

The number or name of the source you wish to plot over for 'covariates_plot', defaults to NULL which means all sources are used

one_plot

Whether to plot line covariates plot on one plot. Defaults to FALSE

n_pred

Number of points to use when plotting line covariates plot. Defaults to 1000.

...

Currently not used

Details

The matrix plot should form a necessary part of any SIMM analysis since it allows the user to judge which sources are identifiable by the model. Further detail about these plots is provided in the vignette.

Value

one or more of 'isospace', 'beta_histogram', 'beta_boxplot', 'prop_histogram', 'prop_density', or 'covariates_plot'

Author(s)

Emma Govan <emmagovan@gmail.com>, Andrew Parnell

See Also

See cosimmr_ffvb for creating objects suitable for this function, and many more examples. See also cosimmr_load for creating simmr objects, plot.cosimmr_input for creating isospace plots.

Examples



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

# The data
data(geese_data_day1)

# Load into simmr
simmr_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(simmr_1)


# FFVB run
simmr_1_out <- cosimmr_ffvb(simmr_1)

plot(simmr_1_out, type = c("isospace", "beta_hist"))


[Package cosimmr version 1.0.12 Index]