For this demonstration, we will use random walk data as it can easily be generated. Note that the price series associated with a specific asset should be organized along a row. Here we do replication generation.

library(finmodtk)
price_series <- t(sapply(1:15, function(i) cumsum(rnorm(100))+1000))
norm_series <- t(apply(price_series, 1, price_norm))
synth <- pedroso_synthesis(price_series, theta = 1, extra = 0, repl = TRUE)
par(mfrow = c(1,2))
matplot(t(norm_series), type = "l", lty = 1, main = "Original")
matplot(t(synth$synth_prices), type = "l", lty = 1, main = "Original")


wzhorton/finmodtk documentation built on July 31, 2020, 9:18 p.m.