r - Vector Autoregressive Models for Multivariate Time Series : Trend and Seasonality -


i have 3 time series , want predict future values each of them. using vars! package in r.

so approach:

  1. decompose multiplicative time series , take out trend, seasonality, , random part.

    time_series1_components = decompose(time_series1,type="mult") 

do time series.

  1. apply var model on random parts , predict future values:

    random_part1 = time_series1_components$random random_part2 = time_series2_components$random random_part3 = time_series3_components$random merged_df = ts.union(random_part1, random_part2,random_part3, dframe = true) merged_mat <- data.matrix(merged_df) merged_mat = na.exclude(merged_mat) checklag = varselect(merged_mat) estimatemodel=var(merged_mat, p = 2, type = "const", season = null, exogen = null) summary(estimatemodel) roots(estimatemodel) predict(estimatemodel)` 
  2. now, should combine predicted values of random part trend , seasonality. , plot graph showing past values , predicted values (highlighted separately). how can achieve this? pointers helpful.


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -