The rolling_beta() is a generic S3 function that builds upon 'type-safe'-esque workflows limited to classes in in base R, and the package-wide dependencies. Ie. class in, class out.
See also
Other Rolling Statistic:
rolling_correlation(),
rolling_max(),
rolling_min(),
rolling_standard_deviation(),
rolling_sum(),
rolling_variance()
Examples
## load Bitcoin (BTC)
## series
data(BTC, package = "talib")
## calculate the rolling statistic
## between Open and Close
output <- talib::rolling_beta(x = BTC[[1]], y = BTC[[4]])
## display the results
utils::tail(output)
#> [1] 0.167234235 0.141477872 0.212146797 0.004301746 0.069313219 0.054557930
