View source: R/ts-random-walk-plot.R
| ts_random_walk_plot | R Documentation |
Plot a random walk with side-by-side facets showing both the random variable and cumulative product (random walk path).
ts_random_walk_plot(.data, .interactive = FALSE)
.data |
The data from |
.interactive |
The default is FALSE, TRUE will produce an interactive plotly plot. |
This function will take output from the ts_random_walk() function
and create a side-by-side faceted plot. The left panel shows the random
variable (y) over time, and the right panel shows the cumulative product (cum_y, i.e., the random walk path)
over time. Each simulation run is shown as a separate line. The legend is set
to "none" if the simulation count is higher than 9.
A ggplot2 object or an interactive plotly plot
Steven P. Sanderson II, MPH
Other Plot:
ts_brownian_motion_plot(),
ts_event_analysis_plot(),
ts_qq_plot(),
ts_scedacity_scatter_plot()
df <- ts_random_walk(
.mean = 0,
.sd = 1,
.num_walks = 25,
.periods = 180,
.initial_value = 100
)
ts_random_walk_plot(df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.