plot.cosimmr_pred_out {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_pred_out'
plot(
  x,
  type = c("beta_histogram", "beta_boxplot", "prop_obs", "prop_density"),
  obs = 1,
  cov_name = NULL,
  binwidth = 0.05,
  alpha = 0.5,
  title = NULL,
  n_output = 3600,
  ...
)

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 you wish to plot

cov_name

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

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

...

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
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)

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


[Package cosimmr version 1.0.12 Index]