# Multivariate Time Series Analysis – Predict Multiple Periods Ahead

**URL:** <https://forum.knime.com/t/multivariate-time-series-analysis-predict-multiple-periods-ahead/62507>\
**Category:** KNIME Analytics Platform\
**Tags:** time-series\
**Created:** [February 24, 2023, 8:15am UTC](https://forum.knime.com/t/multivariate-time-series-analysis-predict-multiple-periods-ahead/62507 "2023-02-24T08:15:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tim\_19801](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/t/22d042/32.png) [@tim\_19801](https://forum.knime.com/u/tim_19801)\
**Post date:** [February 24, 2023, 8:15am UTC](https://forum.knime.com/t/multivariate-time-series-analysis-predict-multiple-periods-ahead/62507/1 "2023-02-24T08:15:52Z")

</div>

I have spent the past few 20 months looking into different software to help me predict the opening daily stock price into the future. All software has the ability to rank/score testing data against actual data using multiple variables as inputs, however there is limited literature or discussion on actual prediction into the future when no data is avilable.

I have found Kathrin’s “Multivariate Time Series Analysis with an RNN - Training and Deployment” models. As this is one of the few examples on the internet that predict a future result when no other future variables are present it is very useful. It is only limited in that it predicts the next single output and not multiple periods ahead.

I have modified Kathrin’ model and input dataset to align with my aim of predicting the next daily “opening price” for 100 days into the future. I would however like to predict the daily opening price for the next 100 days (100 individual outputs in sequence). There is some discussion on different forum posts that a loop could be used but there are no useful examples.

I am hoping someone might have setup a project that does something similar and be able to share it, or alternatively examine the 2x workflows I have uploaded and provide some much needed advice (link below). The alternate would be to take Kathrin’s original model and add additional prediction periods to it (eg instead of predicting only the next hour, predict the next 36 hours).

Many thanks,

Tim

> **[tim\_19801/Public](https://hub.knime.com/tim_19801/spaces/Public/latest/~ORfjlHLkAffsB08d/)**
>
> contains 3 items

---

<div class="post-metadata">

**Author:** ![Daniel\_Weikert](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/d/e47c2d/32.png) [@Daniel\_Weikert](https://forum.knime.com/u/Daniel_Weikert)\
**Post date:** [February 24, 2023, 5:43pm UTC](https://forum.knime.com/t/multivariate-time-series-analysis-predict-multiple-periods-ahead/62507/2 "2023-02-24T17:43:53Z")

</div>

I have built that in python long time ago and there are basically 2 options i can think of (and you already pointed out)  
Either let the model spit out 100 outputs (probably to much I would rather make it a smaller window) in one go  
or predict only the next day and then add this prediction on top of your input sequence, remove the oldest data point (so you got the same amount of timesteps for your input sequence which the model expects) and then predict based on the prediction value itself (hope that was understandable)  
So you probably need to wrap the loop around the creation of the new sequence and predictor node  
br

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [May 25, 2023, 5:44pm UTC](https://forum.knime.com/t/multivariate-time-series-analysis-predict-multiple-periods-ahead/62507/3 "2023-05-25T17:44:27Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
