In your experience, which approach is better in what circumstances? To answer this question, implement both approaches in R. Design and carry out a numerical study to compare the empirical performance of both approaches in forecasting volatility. In executing this task, please bear in mind the following points.
- You may wish to base your argument on a diverse selection of financial time series (e.g. foreign exchange, individual share prices, stock indices from various regions of the world). For each dataset you use, please say precisely how you have obtained it; your reference must be precise enough for your reader to be able to obtain exactly the same dataset. For this project, it is enough to focus on daily data.
- As of April 2020, many financial markets are experiencing huge fluctuations; it would be of great interest how the two approaches compare in particular during this extraordinary period. You may want to include the period January-April 2020 in your test sets.
- Please remember to base your findings on a variety of forecasting horizons; not only “one day ahead”. What error measure are you going to use? How are you going to measure the “true” volatility to be forecast? - Please include your R code in the appendix; it must be commented and executable on a clean install of R. With the help of the code, your reader must be able to reproduce exactly any tables and/or figures included in your answer to this question.
This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.#======================================================================================
# Loading the libraries #
# Loading the data #
data1 = read.csv("GSPC.csv")
data1$Date = as.Date(data1$Date, "%Y-%m-%d")
# Create return series #
# Number of total observations
n = dim(data1)
# define the return series
returns = log(data1$Close[2:n]) - log(data1$Close[1:(n-1)])
# extract dates into a variable and make a new dataframe
dates = data1$Date[-1]
data = data.frame(dates = dates, returns = returns)
# plot returns series
plot(dates, returns, type = 'l')...