Write a function in R achieving the following targets: (In the following, it describes the functionality that
Question:
Write a function in R achieving the following targets: (In the following, it describes the functionality that your function needs to have. Do NOT write an individual function for each requirement. The desired answer is one single function who has the following methods.) 1. Download daily stock data using a given stock ticker for a given time period (set starting time, ending time, and stock ticker as input variable). 2. Get the adjusted close price and consider this price data only for the following tasks. 3. Perform a rolling window estimation on the stock price vector to calculate the mean and standard deviation. For each time, you keep using a fixed size of data to calculate the mean and the standard deviation. (e.g. The whole sample contains 5 data points. You can perform a rolling window estimation with a window size of 2. In the first window (subset), you calculate the mean and standard deviation (std) using the first two data points. Then you will roll the window one step ahead and calculate the mean and std using the second and the third data points. You repeat the same procedure using the fixed size of data until the end of the whole sample.) The window.
Automation Production Systems and Computer Integrated Manufacturing
ISBN: 978-0132393218
3rd edition
Authors: Mikell P.Groover