# Time series analysis for stock prices

I am using GARCH model to simulate price of an index for 7 years. For input I am using difference of Log of prices (log of return). GARCH(1,1) has the lowest AIC, and I found parameters for the GARCH model and I simulated price of the index for 100 times using the following code using PYTHON.

mu = [0.000103]
omega =  [0.000003]
alpha1 = [0.121624]
beta1 = [0.859032]

maturity = 21*12*7 +6*21
scenarios = 100
init_log_return =list(np.log(IDV).diff().iloc[-1,:])
monthlyreturn_GARCH = np.zeros((scenarios, maturity, len(Index)))
volatility_GARCH = np.zeros((scenarios, maturity, len(Index)))
monthly_prices_GARCH = np.zeros((scenarios, maturity, len(Index)))

for scenario in range(0, scenarios):
for index in range(len(Index)):
monthly_prices_GARCH[scenario][index] = IDV.iloc[-1,:][index]
monthlyreturn_GARCH[scenario][index] = init_log_return[index]
Ut = monthlyreturn_GARCH[scenario][index] - mu[index]
volatility_GARCH[scenario][index] = (Ut / np.random.normal(0, 1))**2

for day in range (1,maturity):
volatility_GARCH[scenario][day][index] = omega[index] + alpha1[index]* Ut**2 + beta1[index]*volatility_GARCH[scenario][day-1][index]
Ut = np.sqrt(volatility_GARCH[scenario][day][index] )* np.random.normal(0, 1)
monthlyreturn_GARCH[scenario][day][index] = mu[index] +Ut
monthly_prices_GARCH[scenario][day][index] = np.exp(np.log(monthly_prices_GARCH[scenario][day-1][index]) + monthlyreturn_GARCH[scenario][day][index])


However, when I plot variance over time I am getting the following output. The daily volatility is very high at the beginning and then it will become very small. The results does not look right. Is there any methods other than GARCH that can give me better results? or do you have any idea what went wrong here? or do you have any suggestion for improvements?

• The long run variance should not go to zero. Check that your implementation is correct as given here stats.stackexchange.com/questions/314428/… – Alex C Nov 8 '18 at 2:10
• @AlexC I edited my post. The long run variance becomes very small, but since it is daily variance it makes sense. However, at beginning the daily variance is too high. It doesn't seem right to me. Do you know what went wrong? – Himeh Nov 8 '18 at 5:48