50% off | Unlimited Data & AI Learning

Last chance! 50% off unlimited learning

Sale ends in


healthyR.ts (version 0.3.1)

ts_brownian_motion_plot: Auto-Plot a Geometric/Brownian Motion Augment

Description

Plot an augmented Geometric/Brownian Motion.

Usage

ts_brownian_motion_plot(.data, .date_col, .value_col, .interactive = FALSE)

Value

A ggplot2 object or an interactive plotly plot

Arguments

.data

The data you are going to pass to the function to augment.

.date_col

The column that holds the date

.value_col

The column that holds the value

.interactive

The default is FALSE, TRUE will produce an interactive plotly plot.

Author

Steven P. Sanderson II, MPH

Details

This function will take output from either the ts_brownian_motion_augment() or the ts_geometric_brownian_motion_augment() function and plot them. The legend is set to "none" if the simulation count is higher than 9.

See Also

Other Plot: ts_event_analysis_plot(), ts_qq_plot(), ts_scedacity_scatter_plot()

Examples

Run this code
library(dplyr)

df <- ts_to_tbl(AirPassengers) %>% select(-index)

augmented_data <- df %>%
  ts_brownian_motion_augment(
    .date_col = date_col,
    .value_col = value,
    .time = 144
  )

 augmented_data %>%
   ts_brownian_motion_plot(.date_col = date_col, .value_col = value)

Run the code above in your browser using DataLab