1. Homepage
  2. Programming
  3. Financial Computing - Assignment Chapter 3: Time Series, Autocorrelation, Autoregressive and Volatility Process

Financial Computing - Assignment Chapter 3: Time Series, Autocorrelation, Autoregressive and Volatility Process

Engage in a Conversation
Financial ComputingTime Series Autocorrelation AutoregressiveVolatility ProcessPython

Financial Computing Assignment Chapter 3 Time Series CourseNana.COM

Notes: •Provide commented programming code (Python language preferred) that can be executed. Your submitted solution will be tested on computer. Pictures or screen-shots of programming code are not accepted . •If you use standard Python, submit (1) a document (.pdf preferred, .docx accepted) with your answer and (2) the Python file (.py) with the commented code. (Your answers can copy the output of your programming code, when applicable). •If you use Jupyter Notebook, you can include both the answer and programming code in the notebook. Create separate sections for answers as text notes (markdown sessions). Run your code and display all results. Download the whole notebook in (1) either .pdf (preferred) or .html (accepted) and submit it. •Import packages you use and include package installation instructions as comment in you programming code • Report numbers up to the 4th decimal or higher in your answer 1 Exercise: Autocorrelation (15 points) The file "000001SZ.csv" contains time series of adjusted prices and return of PingAn Bank. CourseNana.COM

  1. Write a function that calculates the autocorrelation with arguments x(time series) and lag 2.Assign two series: X1with data from January 2001 to December 2010 and X1with data from January 2011 and December 2020.
  2. Compute the autocorrelation for the two series at lag= 1;:::; 22
  3. Plot results of the autocorrelations in autocorrelograms (use barplot) Do not use the already implemented functions for autocorrelation in statmodels.tsa or in pandas 2 Exercise: Autoregressive Process (30 points) The file ret5.csv contains 5 (adjusted) return series of randomly selectes stocks listed in the Shenzhen Stock Exchange for the last 20 years. Note that there are missing values that you can either replace Chapter 3 - Lab 1|3 with 0 or disregard (as if in those days the trading is closed). Fit a AR(1)model to each of those time series by implementing the following points: [NOTE: You are not allowed to use external packages or modules with the implementation] 1.Define a function fit_ar(params, x) that returns the residual from an AR(p) with arguments "params" and time series "x"
  4. Define a function ar_loglike(params, x) that return the log likelihood of the AR model 3.Define a function optim_par(x, init_par) that returns the estimated parameters by maximum likelihood of a AR(2) model 4.Plot the estimate for 0(intercept) and 1(first order partial autocorrelation) for each of the time series in a line or dot plot 5.Plot the residuals of each 5 time series as a line plot on the (xaxis = date, yaxis = residual) space. 3 Exercise: Time Varying (Conditional) Volatility Process (35 points) [Second stage estimation] With the data and estimated parameters of the previous exercise, fit an AR(1)-GARCH(1,1) model for each of the 5 time series, implementing the following points: [NOTE: You are not allowed to use external packages or modules with the implementation] 1.Define a function fit_GARCH11(params, epsilon) that return the time-varying conditional variance (ht) and standardized residuals ( epsilon t=p (ht)) of the GARCH(1,1) model, where the argument epsilon is the series (ndArray) of residuals from the AR(1) 2.Define a function garch11_loglike(params, epsilon) that return the log likelihood of the GARCH(1,1) model, where the argument "epsilon" is the series (ndArray) of residuals from the AR(1) 3.Define a function optim_par_garch11(epsilon, init_par) that returns the estimated parameters by maximum likelihood of the GARCH(1,1) model. Use the SciPy package. You may want to try different optimization algorithms (e.g. "SLSQP", "Nelder-Mead", "trust-constr") to check their power. 4.Plot the estimate for the 3 parameters of the GARCH(1,1): (!; ; ), in a line or dot plot for each of the 5 time series. 5.Plot the standardized residuals of each 5 time series as a line plot on the (xaxis = date, yaxis = residual) space. Chapter 3 - Lab 2|3 4 Exercise: Simulation (20 points) Using the data and estimated parameter of the AR(1)-GARCH(1,1) of the previous exercises run a (historical) simulation by implementing the following points. 1.Choose 1 stock return from any of the 5 returns in the dataset. Consider p0= 100 is the starting price of the stock. Compute ptthe price for t= 1;:::; 2490 2.Simulate 10 possible price trajectories with AR(1) and constant volatility [NOTE: The chinese stock market imposes a 10% limit return. Hard code this limit in the simulated price by correcting the return whenever they exceed this limit.]
  5. Plot the actual price with the simulated trajectories for (AR(1)) in two separate plots. 4.Simulate 10 possible price trajectories with AR(1)- GARCH(1,1) conditional volatility [NOTE: The chinese stock market imposes a 10% limit return. Hard code this limit in the simulated price by correcting the return whenever they exceed this limit.] 5.Plot the actual price with the simulated trajectories for (AR(1)-GARCH(1,1)) in two separate plots. Chapter 3 - Lab 3|3

Get in Touch with Our Experts

WeChat WeChat
Whatsapp WhatsApp
Financial Computing代写,Time Series代写, Autocorrelation代写, Autoregressive代写,Volatility Process代写,Python代写,Financial Computing代编,Time Series代编, Autocorrelation代编, Autoregressive代编,Volatility Process代编,Python代编,Financial Computing代考,Time Series代考, Autocorrelation代考, Autoregressive代考,Volatility Process代考,Python代考,Financial Computinghelp,Time Serieshelp, Autocorrelationhelp, Autoregressivehelp,Volatility Processhelp,Pythonhelp,Financial Computing作业代写,Time Series作业代写, Autocorrelation作业代写, Autoregressive作业代写,Volatility Process作业代写,Python作业代写,Financial Computing编程代写,Time Series编程代写, Autocorrelation编程代写, Autoregressive编程代写,Volatility Process编程代写,Python编程代写,Financial Computingprogramming help,Time Seriesprogramming help, Autocorrelationprogramming help, Autoregressiveprogramming help,Volatility Processprogramming help,Pythonprogramming help,Financial Computingassignment help,Time Seriesassignment help, Autocorrelationassignment help, Autoregressiveassignment help,Volatility Processassignment help,Pythonassignment help,Financial Computingsolution,Time Seriessolution, Autocorrelationsolution, Autoregressivesolution,Volatility Processsolution,Pythonsolution,