sim_ts | R Documentation |
sim_ts()
is mostly a helper function, to be used
internally in this package, but you can use it here to simulate a time series.
sim_ts(n, b0 = 0, bt = 0, rho = 1, white_noise = FALSE, rsd = 1)
n |
a numeric vector for the length of the series |
b0 |
a numeric vector for a potential drift in the series. Defaults to 0 |
bt |
a numeric vector for a potential trend in the series. Defaults to 0. |
rho |
a numeric vector for the simple autoregressive parameter. Defaults to 1. |
white_noise |
= logical, defaults to FALSE. If FALSE, generates a random walk. If TRUE, series is white noise. |
rsd |
the standard deviation for a normal distribution to be simulated. Defaults to 1. |
sim_ts()
returns a numeric vector of a simulated time series
that would follow the user's input.
Steven V. Miller
set.seed(8675309) # don't want new numbers in documentation every time...
sim_ts(25)
sim_ts(25, b0 = 1)
sim_ts(25, b0 = 1, bt = .05)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.