ARIMA Model with EM price data

Here is a simple example of an ARIMA model with pricing data. This is just an example to show the basic code used for ARIMA. Statistical tests in order to choose the appropriate model/lags are not included. import osos.chdir(r”C:\Users\haderer\Documents\python”)cwd= os.getcwd()print(“Current working directory is:”, cwd) import numpy as npimport sysnp.set_printoptions(threshold=sys.maxsize)import pandas as pdfrom matplotlib import pyplot as pltfrom statsmodels.tsa.stattools import adfullerfrom […]

Dickey-Fuller Test

The null hypothesis of the dickey fuller test is that your data is a random walk. Sample Regression : Now we could use our stock returns as an example Y = return today a = lets asume its 0 x= return yesterday b = slope of returns regression line E = White noise Now we test if b (slope of […]

Random Walk

It is not possible to make a forcast of a random walk. Lets have a look at the formula: Example from the stock market: Todays stock price 5 Euro Yesterdays stock price 4 Euro Error (would be the retrun) = 1 Euro

Autocorrelation

Autocorrelation measures the correlation of a time series with itself. Therefore, when analyzing autocorrelation, the correlated variables are the same, measured on different dates. (eg. – 1 month = 1 lag) An autocorrelation different from 0 implies that a dataset can be forecast out of its past. For example, let’s assume an EM Index is autocorrelated. Also, you have the […]

Stationarity/ White noise

In general, we need stationary time series in order to build statistical models. That means there should be no systematic change in the mean/variance of the data.Also, the data should have no seasonality (periodic fluctuations). However, most financial/economic data is non-stationary. That means there is some trend (systematic change) or seasonality.Therefore we need to transform this data in order to […]

p-value

Shows you the probability that you are wrong in case you reject the null hypothesis. (cause it is actually right) Example 1: Eg. You have a p-value of 4%. That means if you reject the null hypothesis you will make a mistake with a probability of 4%. Example 2: Eg. You have a p-value of 40% That means if you […]