Sie sind auf Seite 1von 3

SIMULATING THE SYSTEM IN MATLAB (SAMPLE ASSIGNMENT) For any Help with Simulating the System in MATLAB Assignment

upload your Homework Assignment by clicking at Submit Your Assignment button or you can email it to info@matlabassignmentexperts.com. To talk our Online Simulating the System in MATLAB Project Tutors you can call at +1 5208371215 or use our Live Chat option.

Simulate Conditional Variance Model


This sample assignment shows how to simulate a conditional variance model using simulate. Step 1. Load the data and specify the model. Load the Deutschmark/British pound foreign exchange rate data included with the toolbox, and convert to returns. Specify and fit a GARCH(1,1) model.

load Data_MarkPound r = price2ret(Data); N = length(r); model = garch(1,1); fit = estimate(model,r); V0 = infer(fit,r);


For details about model selection and specification for this data, see:

Specify a Conditional Variance Model Likelihood Ratio Test for Conditional Variance Models Step 2. Simulate foreign exchange rate returns. Use the fitted model to simulate 25 realizations of foreign exchange rate returns and conditional variances over a 1000-period forecast horizon. Use the observed returns and inferred conditional variances as presample innovations

and variances, respectively.

rng('default') [V,Y] = simulate(fit,1000,'numPaths',25,... 'E0',r,'V0',V0); figure(1) subplot(2,1,1) plot(V0) hold on plot(N+1:N+1000,V) xlim([0,N+1000]) title('Conditional Variances') hold off subplot(2,1,2) plot(r)

hold on plot(N+1:N+1000,Y) xlim([0,N+1000]) title('Returns') hold off

Step 3. Plot the returns distribution at a future time. Use simulations to generate a forecast distribution of foreign exchange returns 500 days into the future. Generate 1000 sample paths to estimate the distribution.

rng('default') [V,Y] = simulate(fit,500,'numPaths',1000,... 'E0',r-fit.Offset,'V0',V0); figure(2) hist(Y(500,:)) title('Return Distribution in 500 Days')

Das könnte Ihnen auch gefallen