Computational Finance
EViews
1. For creating lag:
Open file
Quick Generate series
Equation: lag1=close(-1), lag2=close(-2)
2. First difference:
Quick Generate series
fd=d(close)
3. Second difference:
Quick Generate series
sd=d(close,2)
4. Returns:
Quick Generate series
Closeret=d(log(close))
5. For creating graph:
Open close/ closeret
View graph
Ok for the dialogue box
6. ACF(MA), PACF(AR):
Quick series statistics Correlogram
Series name: close / closeret (depends on question)
Inference:
See partial correlation
If first 10 observations are within the lines, then it is non significant.
If not, it is significant, so we need to find close return and repeat
ACF.
7. ADF:
Augmented Dickey Fuller Test
Click (Open) closeret
View Unit root tests Standard Unit Root tests
Automatic selection: Change to AIC
Inference:
Hypothesis:
H0: There is a unit root – non stationary.
H1: There is no unit root - stationary.
If p value (Prob.*) is less than alpha(0.05), reject null.
8. ARMA (manual):
Click (Open) closeret
Quick Estimate equation
Closeret c ar(1) ma(1)
Closeret c ar(1) ar(2) ma(1)
.
.
Continue….
For the table value, refer AIC value.
Start table from ar(0), ma(0).
Inference:
Model having the lowest AIC value is the best choice as it balances
goodness of fit and model complexity.
Eg: like ar(1) ma(4)
9. Auto ARIMA:
Fist to find: fd
Click fd Proc Automatic ARIMA Forecasting
10. Auto ARIMA forecasting:
Fist to find: fd
Click range
Give the start date as same in the file
Give the end date as needed in the question
Like, if the question is given as forecast for 5 days, give the end
date 5 days after the date in the question (look for Saturday and Sunday –
If it has add dates accordingly 6 or 7).
Give yes for insert n(like 5) of observations
Give no for the coming dialogue boxes.
Click fd Proc Automatic ARIMA Forecasting
Change:
The date to original as in Estimation sample
Forecast length – 5 (the number of days needed to forecast)
Max AR – 5, Max MA – 5
Click Options:
Select (Tick) all (4) table and graph
11. ARIMA Forecasting (manual):
Click (Open) closeret
Quick Estimate equation
fd c ar(1) ma(1)
fd c ar(1) ar(2) ma(1)
.
.
Continue….
12. For residual table and graph (Only for forecasting):
Find closeret
Click closeret
Quick Estimate equation
Give the ARMA equation of the best model.
Eg: If (2,3) is the best model selected from ARMA, then give the
equation as
Closeret c ar(1) ar(2) ma(1) ma(2) ma(3).
Then click view Actual, fitted residual Actual, fitted residual
table/graph.
13. Diagnostic checking:
Quick Estimate Equation (equation of the obtained ARIMA model eg-
(2,2) here) d(close) c ar(1) ar(2) ma(1) ma(2) .
View Residual Diagnostics Correlation Q statistics:
Correlation squared residuals
Histogram (Normality tests)
Heteroskedasticity Tests
(i) Correlation Q statistics:
Give ok (default) for lag to include
Look for significance as usual like ACF and PACF ( within lines)
(ii) Correlation squared residuals:
Give ok (default) for lag to include
Look for significance as usual like ACF and PACF ( within lines)
(iii) Histogram (Normality tests):
Check the shape of the curve for normality, skewness and Kurtosis.
(iv) Heteroskedasticity Tests:
Test type: ARCH
Number of lags: default
Check the probability of the lag. If it is less than 0.05, presence of
heteroskedasticity.
Check p value(Prob.*) at RESID^2(-1)
14. VAR:
Open file (spot fut)
Quick series statistics unit root test give spot_ret and etf_ret
See the prob value and estimate the significance based on the value p<
alpha or not
Again,
Click quick Estimate Var
In endogeneous variable give Spot_ret and etf_ret OK
In that tab Click view lag structure lag length criteria
See the AIC * value ( which is lowest ) (don’t close the tab)
In that tab click forecast and cancel
Write the 2 equation
15. VECM:
Checking Cointegration:
Quick group statistics johansens OK
See none value whether it is cointegrated or not (P< Alpha)
If the test is cointegrated proceed the following
Next…..
Open file ( Coint )
Select Nifty and nifty bees (both)
Right click the both open as group
In that tab Quick estimate var
In var type vector error correction
In endogeneous Nifty, Niftybees
Click proc make system order by variable Equation will come
Write those two eqations.
TIME SERIES MODELLING STEPS:
1. Identification:
(i) ACF, PACF (significance)
(ii) ADF (unit root – stationarity)
2. Estimation:
ARMA, ARIMA manual (best model – lowest AIC Value)
Auto ARIMA
3. Diagnostic Checking:
Residuals Correlation Q statistics (significance)
Correlation squared residuals (significance)
Histogram (Normality tests)
Heteroskedasticity Tests (significance)
4. Forecasting:
HYPOTHESIS:
1. ADF Test:
H0: There is a unit root – non stationary.
H1: There is no unit root - stationary.
If p value (Prob.*) is less than alpha(0.05), reject null.
2. Johansen’s Cointegration Test:
H0: There is no cointegration.
H1: There is a cointegration.
See p value(prob.*) for none in both Rank test and eigen value
3. Heteroskedsticity:
Null hyp: There is no heteroskedasticity in the residuals.
Alt hyp: There is heteroskedasticity in the residuals
If the p-value > 0.05, fail to reject H₀ → No significant
heteroskedasticity.
If the p-value ≤ 0.05, reject H₀ → Heteroskedasticity is present.
4. Normality Tests:
Null Hyp: The residuals follow a normal distribution.
Alt Hyp: The residuals do *not* follow a normal distribution.
- If *p-value > 0.05* → Fail to reject H₀ → Residuals are *normally
distributed*.
- If *p-value < 0.05* → Reject H₀ → Residuals are *not normally
distributed*. If *Jarque-Bera statistic * is high eg: (35.21850) ,
that shows*significant non-normality* in the residuals.