Simulating Multiple Time Series with Relationships
Simulating Multiple Time Series with Relationships
Loading saved threads...
mr.T · External communityPost link
External question — Cross Validated Stack Exchange
Author: mr.T
Original post: https://stats.stackexchange.com/questions/565337
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
Suppose I have several time series (these are financial series, prices, indicators) with the same time. There may be two or more.
I don’t know what relationships there are between the series, correlations, cointegrations, non-linear relationships, or there are no relationships at all ...
I would like to automatically find out if there are connections and what
I would like to simulate these series with connections
UPD=======
Here is an example of the data I am using
library(quantmod)
getFX("EUR/USD")
getFX("GBP/USD")
eu <- as.vector(EURUSD$EUR.USD)
gb <- as.vector(GBPUSD$GBP.USD)
library(TTR)
roll.cor <- TTR::runCor(eu,gb , n = 5)
rsi <- TTR::RSI(eu,n = 5)
mydata <- cbind(eu,gb,roll.cor,rsi)
> mydata
eu gb roll.cor rsi
[1,] 1.177237 1.372932 NA NA
[2,] 1.179440 1.376770 NA NA
[3,] 1.179474 1.376679 NA NA
[4,] 1.179910 1.376033 NA NA
[5,] 1.181616 1.376859 0.83911455 NA
[6,] 1.182466 1.376244 -0.15342956 100.000000
[7,] 1.185494 1.380270 0.84880800 100.000000
[8,] 1.188066 1.384948 0.95413564 100.000000
[9,] 1.187910 1.386290 0.97020360 97.715547
[10,] 1.187945 1.386288 0.98141920 97.730090
[11,] 1.186888 1.384056 0.95570036 78.794634
[12,] 1.186068 1.380795 0.93082598 66.331768
[13,] 1.182712 1.377056 0.97051123 36.664213
[14,] 1.182410 1.381155 0.82146557 34.907988
I have a trading strategy that works on this historical data, I would like to simulate many hundreds of years of similar data in order to test the strategy better and also find more optimal parameters...
I'm wondering if this can be done and how to do it
Quote
Report
Hans-Peter Schrei · External communityPost link
External answer — Cross Validated Stack Exchange
Author: Hans-Peter Schrei
Original post: https://stats.stackexchange.com/a/565361
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
A general way to generate time series data based on an already existing dataset, is implemented by the Synthetic Data Vault, an ecosystem of libraries that allows one to learn single-table, multi-table and timeseries datasets to later on generate new Synthetic Data that has the same format and statistical properties as the original dataset:
https://sdv.dev/SDV/
. As a caveat, it is not exclusively focused on on finance/trading strategies.
However, the tutorial page of the PAR model (
https://sdv.dev/SDV/user_guides/timeseries/par.html
) uses a dataset consisting of financial time series similar to the ones given in the question.
A detailed technical breakdown of the methods used can be found in the published paper:
https://dai.lids.mit.edu/wp-content/uploads/2018/03/SDV.pdf
Quote
Report
Post Reply
Checking account access…