Stock and flow

In econometric time series, quantities are often defined as stock or flow. A stock measurement refers to a quantity at a specific point in time. For example, the value of the S and P 500 on December 31, 2008 is a stock measurement. A flow measurement is a rate over an interval of time. The rate the US Stock Market increased from 2009 to 2010 is a flow measurement.

Most often when forecasting, we care to forecast flow. If we imagine forecasting as a specific kind of regression then the first and most obvious reason for our preference for flow is because flow estimates are far more likely to be interpolation instead of extrapolation, and interpolation is almost always safer. Additionally, most time series models have an assumption of stationarity. A stationary time series is one whose statistical properties (mean, variance, and autocorrelation) that are constant over time. If we were to use stock measurements of a quantity, we would find that most real-world problems would be far from stationary.

While there aren't assumptions (read rules) requiring stationarity when using LSTMs for time series analysis, in practical experience, I've found LSTMs trained on relatively stationary data to be far more robust. First order differencing is sufficient in almost all cases when using LSTMs for time series forecasting.

Converting a stock quantity to a flow quantity is fairly straightforward. If you have n points, you can create n-1 flow measurements with first-order differencing, where, for each value t'n , we calculate it by subtracting tn-1 from tn, giving us the rate of change between the measurements across the interval, as shown in the following formula:

For example, if we owned a stock in March worth 80 dollars, and it were suddenly worth 100 dollars in April, the flow rate of the quantity would be 20 dollars.

First-order differencing doesn't guarantee a stationary time series. We might also need to remove seasons or trends. De-trending is a big part of the daily life of professional forecasters. If we were using a traditional statistical model to forecast, more work would be required. While we don't have the pages to cover that, we may also need to perform second order differencing, seasonal detrending, or more. The augmented Dickey-Fuller (ADF) test is a statistical test often used to determine if our time series is in fact stationary. If you'd like to know if your time series is stationary, you can used the augmented Dickey-Fuller test to check (https://en.wikipedia.org/wiki/Augmented_Dickey%E2%80%93Fuller_test). For LSTMs, however, first-order differencing might often be good enough; just understand that the network most certainly will learn seasons and periods left in your dataset.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.22.61.218