View source: R/plot_mvgam_series.R
| plot_mvgam_series | R Documentation |
This function takes either a fitted mvgam object or a
data.frame object and produces plots of observed time series, ACF,
CDF and histograms for exploratory data analysis
plot_mvgam_series(
object,
data,
newdata,
y = "y",
lines = TRUE,
series = 1,
n_bins = NULL,
log_scale = FALSE
)
object |
Optional |
data |
Optional |
newdata |
Optional |
y |
Character. What is the name of the outcome variable in the supplied
data? Defaults to |
lines |
Logical. If |
series |
Either an |
n_bins |
|
log_scale |
|
A set of ggplot objects. 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.
Nicholas J Clark and Matthijs Hollanders
# 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'
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.