plot_mvgam_series {mvgam} | R Documentation |
Plot observed time series used for mvgam modelling
Description
This function takes either a fitted mvgam
object or a data_train
object
and produces plots of observed time series, ACF, CDF and histograms for exploratory data analysis
Usage
plot_mvgam_series(
object,
data,
data_train,
newdata,
data_test,
y = "y",
lines = TRUE,
series = 1,
n_bins,
log_scale = FALSE
)
Arguments
object |
Optional |
data |
Optional |
data_train |
Deprecated. Still works in place of |
newdata |
Optional |
data_test |
Deprecated. Still works in place of |
y |
Character. What is the name of the outcome variable in the supplied data? Defaults to
|
lines |
Logical. If |
series |
Either a |
n_bins |
|
log_scale |
|
Value
A set of base R
graphics plots. If series
is an integer, the plots will
show observed time series, autocorrelation and
cumulative distribution functions, and a histogram for the series. If series == 'all'
,
a set of observed time series plots is returned in which all series are shown on each plot but
only a single focal series is highlighted, with all remaining series shown as faint gray lines.
Author(s)
Nicholas J Clark
Examples
# Simulate and plot series with observations bounded at 0 and 1 (Beta responses)
sim_data <- sim_mvgam(family = betar(),
trend_model = RW(), prop_trend = 0.6)
plot_mvgam_series(data = sim_data$data_train, series = 'all')
plot_mvgam_series(data = sim_data$data_train,
newdata = sim_data$data_test, series = 1)
# Now simulate series with overdispersed discrete observations
sim_data <- sim_mvgam(family = nb(), trend_model = RW(),
prop_trend = 0.6, phi = 10)
plot_mvgam_series(data = sim_data$data_train, series = 'all')