Posts

How to Use ARIMA Model to Predict the Stock Market? (Time Series Analysis-Python)

Image
What is a Time Series? A time series is a series of data points indexed in time order. It is a sequence of discrete-time data. One example of time series data is stock price historical data. One of the main concepts in time series is stationary.  What is stationary data? “Stationary” means the statistical structure of the time series is independent of time. The following chart of US GDP is an example of a time series data. We see that mean and variance of GDP change over time. This is an example of Non-stationary time series data. There are three different ways to finding a data is stationary or not. First by plotting the data as we did in the above chart. We can see an obvious upward trend in our data that suggest Non-stationary data set. Second by measuring summary statistics of our data such as Average and Standard-Deviation of our data in various point of time in our data and check for obvious or significant differences between them. If we found that...

How to scrap Zacks Rank signal in Python

Image
If you trade in the US market or follow market analysis you probably heard about Zacks Rank system provided by Zacks Investment Group. This ranking system is based on fundamental conditions of the company which revise frequently. the Zacks analysts revise their analysis based on most recent information about each company, and at the end Zacks rank each company in five different level. 1- Strong Buy 2- Buy 3- Hold 4- Sell 5- Strong Sell You should be noted that based on Zacks, these are not recommendation for buying or selling the equities, rather these are the analysis of companies fundamental usually based on a benchmark like SP500 index. In other words, for instance if a company has Zacks Rank 3 or Hold, that means its returns is foretasted to be aligned with the SP500 return. For the Zacks Rank 4 or Sell the projection is it under-perform the benchmark and so on. Zacks claim these analysis is the 1 to 3 months projection and can be revised anytime based on the new infor...

Application of GARCH models in R – Part II ( APARCH)

Image
If you read my previous post regards forecasting volatility using GARCH models you won’t have any trouble to forecast volatility by APARCH models. APARCH model is the extended form of GARCH model that allowing to combine two effects in practical use (i.e. asymmetry in the impact of positive and negative lagged returns (i.e. leverage effects) and have flexible power in the volatility calculation). The formula of APARCH is: The APARCH model is one of the most complicated models in use. It allows for leverage effects when gamma is not zero and power effects when delta is not 2. If we impose both values to zero and 2 respectively we just get the GARCH model back. You should note that in many case estimation will fail if the data sample is too short or exhibits structural breaks in volatility like what happened to SP500 index during the 2007-2009 crisis, or it will fail if the data sample size is too short. If we restrict t...