plot.ss_fit {sectorgap}R Documentation

Plots of results

Description

Creates a set of time series, density, or trace plots.

Usage

## S3 method for class 'ss_fit'
plot(
  x,
  plot_type = "timeseries",
  estimate = "median",
  data = data,
  n_col = 3,
  n_sep = 5,
  file_path = NULL,
  title = TRUE,
  save = FALSE,
  device = "jpg",
  width = 10,
  height = 3,
  units = "in",
  highlighted_area = NULL,
  plot_start = NULL,
  plot_end = NULL,
  alpha = 0.05,
  include_burnin = FALSE,
  ...
)

Arguments

x

object of class ss_fit

plot_type

type of plots, options are "timeseries", "density", "trace"

estimate

character specifying the posterior estimate. Valid options are "mean" and "median", the default is estimate = "median".

data

list with at least two named components: tsm is a multiple time series object that contains all observation series, weights is a named list of time series with (nominal) weights, the list names correspond to the different groups, i.e., group1, group2, subgroup1, if present in the model

n_col

number of columns for grid plots

n_sep

increments of x axis ticks in years

file_path

file path for plots

title

boolean indicating if plots should contain titles

save

boolean indicating if plots should be saved, if FALSE, the plots will be printed instead, default is save = FALSE (ignored if file_path is provided)

device

character string with format used in ggsave

width

plot width in units, for grid plots adjusted for the number of plot columns n_col

height

plot height in units, for grid plots adjusted for the number of plot rows implied by n_col

units

units for plot size ("in", "cm", "mm", or "px")

highlighted_area

data frame with two columns called start and end containing start and end date, e.g. 1990.25 and 1992.75 for 1990 Q2 until 1992 Q4 (only used if plot_type = "timeseries")

plot_start

start of x axis in years, e.g., 1990.5 (only used if plot_type = "timeseries")

plot_end

end of x axis in years, e.g., 2010.25 (only used if plot_type = "timeseries")

alpha

cut off value for posterior (only used if plot_type = "density")

include_burnin

logical indicating if burnin phase should be included (only used if plot_type = "trace")

...

ignored

Value

nothing


[Package sectorgap version 0.1.0 Index]