tidy_random_walk {TidyDensity} | R Documentation |
Tidy Random Walk
Description
Takes in the data from a tidy_
distribution function and applies
a random walk calculation of either cum_prod
or cum_sum
to y
.
Usage
tidy_random_walk(
.data,
.initial_value = 0,
.sample = FALSE,
.replace = FALSE,
.value_type = "cum_prod"
)
Arguments
.data |
The data that is being passed from a |
.initial_value |
The default is 0, this can be set to whatever you want. |
.sample |
This is a boolean value TRUE/FALSE. The default is FALSE. If
set to TRUE then the |
.replace |
This is a boolean value TRUE/FALSE. The default is FALSE. If
set to TRUE AND |
.value_type |
This can take one of three different values for now. These are the following:
|
Details
Monte Carlo simulations were first formally designed in the 1940’s while developing nuclear weapons, and since have been heavily used in various fields to use randomness solve problems that are potentially deterministic in nature. In finance, Monte Carlo simulations can be a useful tool to give a sense of how assets with certain characteristics might behave in the future. While there are more complex and sophisticated financial forecasting methods such as ARIMA (Auto-Regressive Integrated Moving Average) and GARCH (Generalised Auto-Regressive Conditional Heteroskedasticity) which attempt to model not only the randomness but underlying macro factors such as seasonality and volatility clustering, Monte Carlo random walks work surprisingly well in illustrating market volatility as long as the results are not taken too seriously.
Value
An ungrouped tibble.
Author(s)
Steven P. Sanderson II, MPH
Examples
tidy_normal(.sd = .1, .num_sims = 25) %>%
tidy_random_walk()