Please follow the following instructions. The instructions indicate how to download daily stock price of Apple, Inc. from 2016-01-01 to 2018-07-31 from Yahoo! Finance.
library(quantmod)
getSymbols("AAPL", src = "yahoo", from='2016-01-01', to='2018-07-31')
AAPLAdj <- AAPL$AAPL.Adj
(By here the data can be downloaded and extracted using RStudio)
a) Show whether the series AAPLAdj evolves with time. If it does, show how to remove the evolution with time and comment on the result.
b) The following code will convert AAPLAdj to monthly log return.
monthly.AAPL <- monthlyReturn(AAPLAdj, subset=NULL, type='log', leading=TRUE) Find sample autocorrelation and partial autocorrelation estimates for monthly.AAPL up to lag 15.
a. Once the data from Yahoo is imported, we need to plot it to see the evolution with time.

From the plots, we can see that AAPLAdj evolves with time. To remove this trend, we need to do de-trending.
For this, we will use moving average
let's say a= moving average, 4 steps for AAPLAdj, this is a smoothened function to capture trend. Then we will subtract this trend from the original stock data "AAPLAdj"
stock_trend = ma(AAPLAdj, order = 4, centre = T)
de-trend = AAPLAdj - stock_trend
plot.ts(de-trend)

b. to get autocorrelation till lag 15, we will use acf function in RStudio.
ACF(monthly.AAPL, lag.max=15) --- use acf forecast option

partial autocorrelation, Pacf(monthly.AAPL,lag.max=15)

Please follow the following instructions. The instructions indicate how to download daily stock price of Apple,...