Multivariate time series analysis

I ma trying to fit a multivariate time series analysis : here is a sample data

date            country   sale
1/01/2018   USA      381
2/01/2018   USA      818
3/01/2018   USA      108
1/01/2018   UK        381
2/01/2018   UK        818
3/01/2018   Uk        222
1/01/2018   Hun     381
2/01/2018   Hun     818
3/01/2018   Hun     233
1/01/2018   Li          381
2/01/2018   Li          818
3/01/2018   Li          233

I want to implement multivariate analysis for this time series, here I have two variables as country and sale. so I need to predict for next 2 years based on values.

I found "tsibble" and "fable" could do this but unable to install "fable", am getting error as"
"Error: package or namespace load failed for ‘fabletools’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):

  • namespace ‘tidyr’ 0.8.1 is already loaded, but >= 1.1.0 is required*
    Error: package ‘fabletools’ could not be loaded"

Any help on the above

It's this a question about time series analysis, or about the fable error that you are getting?

Start with solving the tidyr version error. Run install.packages("tidyr") to get the latest version.

Then try ch 5 here https://otexts.com/fpp2/

1 Like

Its about time series for multivariate analysis, but found a solution based on "fable". So tried that but got error, hence provided that error message. But ultimate goal is to build a multivariate time series model in R. Any example or idea would help.

Thank you Jeremy, installed fable now, will explore. Any example or idea would help.

I have not tried this, so I cannot vouch for its validity, but this looks like it might be what you want https://bookdown.org/singh_pratap_tejendra/intro_time_series_r/multivariate-ts-analysis.html

There is not much else I can do to help. Hopefully this gives you enough to get started.

1 Like