YOU MUST USE RSCRIPT TO COMPLETE ASSIGNMENT
CHOOSE DGX AS THE TICKER
Please use the following instructions.
1. Find any stock you want to research. You can find ticker symbol from Google, Yahoo finance, MSN money, and so on (i.e. The ticker symbol of Apple Inc. is “AAPL”).
2. Run the following steps.
1) Install package ‘quantmod’ and load it.
> install.packages(“quantmod”)
> library(quantmod)
2) Download daily prices of stock (from Jan. 3, 2001 to Dec. 31, 2018) you selected to research. i.e. Suppose that you selected Applied Materials, Inc. whose ticker is “AMAT”. Then, run as follows:
> getSymbols(“AMAT”, src=”yahoo”, from=’2001-01-03′, to=’2018-12-31′)
3) Obtain monthly log stock returns by running the following code. Remember this is the case where you selected Applied Materials, Inc. Because you would select other stock, you would need to put another ticker instead of “AMAT”.
> AMAT.rtn <- monthlyReturn(AMAT$AMAT.Adjusted, subset=NULL, type=’log’, leading=TRUE)
4) Change the data type to ts
rtn <- ts(AMAT.rtn, frequency = 12, start = c(2001,1))
3. Using monthly time series data rtn you obtained above, find a best model for the series. For example, AR(2), MA(3), ARMA(2, 3), ARIMA(2, 1, 5), and so on.
※ IMPORTANT: Please show all works and your comments for full credit