plot_fitted: Plot fitted values of an 'tulip' model

View source: R/autoplot.R

plot_fittedR Documentation

Plot fitted values of an tulip model

Description

This function requires the ggplot2. Whether its namespace is available will be checked when the function is run. ggplot2 is only suggested, not a default import.

Usage

plot_fitted(object, date = NULL, show_anomalies = TRUE, show_params = TRUE)

Arguments

object

Fitted model object returned by tulip()

date

Optional additional vector with dates in format that can be cast to YYYY-MM-DD with same length as object$y, used to create x-axis

show_anomalies

Logical; when TRUE (default), observations that were treated as anomalies during model fit will be marked in orange

show_params

Logical; if TRUE (default) then fitted params will be displayed using ggplot2::facet_wrap()

Examples

set.seed(4278)
y <- rt(100, df = 10) * 10 + 1:100

fitted <- tulip(y = y, m = 12, family = "norm")
tulip:::plot_fitted(object = fitted)


timradtke/heuristika documentation built on April 24, 2023, 1:55 a.m.