Write a function to compute the conditional variance

Assignment Help Engineering Mathematics
Reference no: EM132255410

Time Series and Prediction Computing Homework - Questions

Q1. Write a function in R called "my.garch11.filter" to compute the 1-step ahead conditional variance of a GARCH(1,1) model as well as the log-likelihood. The GARCH(1,1) conditional variance is given by

σt2 = ω + αYt-12 + βσt-12

for t = 1 to T. To start the recursion σ12 is set equal to the sample variance of the time series {Yt}. The log-likelihood is defined

LT(θ) = -(T/2)log2π - ½t=1ΣTlogσt2 - ½t=1ΣT Yt2t2.  

The function "my.garch11.filter"

- requires as input (in this order)

(a) vector containing the time series data Y1, . . . , YT

(b) vector of GARCH(1,1) parameter (ω, α, β)' (in this order)

- returns as output a list containing

(a) sig2: vector of GARCH(1,1) 1-step conditional variances σt2 for t = 1, . . . , T

(b) z: vector of GARCH(1,1) standardized innovations zt = Yt/√(σt2) for t = 1, . . . , T

(c) loglik: scalar log-likelihood

Q2. Write a function in R called "my.garch11.objective" to compute the GARCH(1,1) objective function to be minimized numerically by the R optimizer.

The function "my.garch11.objective"

- requires as inputs (in this order)

(a) vector containing the time series data Y1, . . . , YT

(b) vector of GARCH(1,1) filter parameters (ω, α, β)' (in this order)

- returns as output a the negative of the log-likelihood

The function has to perform these checks on the input parameter

(a) check if all the parameters of the param vector are finite (check the function is.finite in R)

(b) check if the parameters of the GARCH(1,1) satisfies the following constraints: ω > 0, α > 0, β > 0, α + β < 1.

If the vector of parameters fails to satisfy any of these conditions then the function should return "infinity" (Inf).

Q3. Write a function in R called "my.garch11.mle" to estimate the GARCH(1,1) parameters using the nlminb optimizer in R.

The function "my.garch11.mle"

- requires as inputs (in this order)

(a) vector containing the time series data Y1, . . . , YT

(b) a vector of initial values of the GARCH(1,1) parameter (ω, α, β)' (in this order)

- returns as output a vector containing the maximum likelihood estimate of the GARCH(1,1) parameters

The function "my.garch11.mle" has to minimise the objective function "my.garch11.objective" using the nlminb routine. When calling the nlminb routine makes sure that:

(a) You set the lower and upper bound of all the GARCH(1,1) parameters, respectively, to 10-4 and 1.

(b) You start the minimization from the initial value provided by the function.

It is highly recommended to check the help page of the nlminb function including the examples to understand how this function precisely works.

Q4. Write a function in R called "my.garch11.stderr" to estimate the GARCH(1,1) standard errors using numerical second order derivatives.

The function "my.garch11.stderr"

- requires as inputs (in this order)

(a) vector containing the time series data Y1, . . . , YT

(b) vector of containing the MLE estimates of the GARCH(1,1) parameters (ω, α, β)' (in this order)

(c) a scalar parameter h which is the step size used for the numerical approximation of the Hessian

- returns as output the vector of standard errors of the GARCH(1,1) parameters

The standard errors are computed using the asymptotic variance covariance matrix of the ML estimator based on the Hessian of the log-likelihood, that is,

(Var)^^) = [-HT^)]-1

where HT^) is the Hessian evaluated at θ^.

The Hessian HT^) is approximated numerically using finite differences. Let ∈ be defined as θ^h where θ^ is the ML estimator and h is the numerical step size. Let D be a 3x3 dimensional diagonal matrix whose diagonal is equal to ∈. Let ei denote a 3 dimensional vector with 1 in position i and zero otherwise. Then, the (I, j) entry of Ht^) is approximated as

[HT(θ^)]i,j ≈ (LT(1)) - LT(2)) - LT(3)) + LT(4)))/4∈ij

where θ(1), θ(2), θ(3), θ(4) are defined as

θ(1) = θ^ + Dei + Dej

θ(2) = θ^ + Dei - Dej

θ(3) = θ^ - Dei + Dej

θ(4) = θ^ - Dei - Dej

Note - The R files attached contain codes for this assignment. The code is given in attached file to test the functions. The code is also used to evaluate the accuracy of the submission.

Attachment:- Assignment Files.rar

Reference no: EM132255410

Questions Cloud

Describe the strengths and weaknesses of each tool : Assessment tools have two primary purposes: to measure a client's response to treatment. Often, you will find that multiple assessment tools are designed.
Sequence to follow in development of new products : Generally, the best sequence to follow in the development of new products is. The term platform was initially associated with which of the following industries?
Could a person be wicked even if he or she never caused : Would it be possible for a person to be perfectly good and yet cause harm to innocent people?
Elements of business success from operations perspective : What are the key elements of business success from an operations perspective? Relate these ideas to Wyatt's approach.
Write a function to compute the conditional variance : Time Series and Prediction Computing Homework - Write a function in R called "my.garch11.filter" to compute the 1-step ahead conditional variance
You can use the money to buy two tickets : Should you ask your boss if you can use the money to buy two tickets? Why? in flying or lying in business class
What qualities are most important to a successful presidency : Briefly discuss the six qualities that relate to presidential job performance. What qualities are most important to a successful presidency?
Impacts of the size of a company : What are the impacts of the size of a company and the capital budgeting methods?
Explain the value professional nursing organizations have : Discuss how professional nursing organizations support the field of nursing and how they advocate for nursing practice. Explain the value professional nursing.

Reviews

len2255410

3/13/2019 1:59:16 AM

Follow instructions from homework 3. The R files attached contain codes for this assignment. Submission Instructions - Submit your homework by e-mail. It is important that: you send your homework from the e-mail account. The subject of the e-mail must be “homework 3", you must copy and paste in the body of the e-mail the R code containing your function definitions within the lines “# BEGIN CODE" and “# END CODE". (Note that these two lines are not counted as comment lines in the problem set correction.).

len2255410

3/13/2019 1:59:10 AM

Be careful: lines that contain comments should be shorter than 80 characters (otherwise the code may not run and raise an error). Please note that the code you submit should only include the function definitions. (In particular, please make sure the code does not contain any calls to the function “rm"). You have five retries (in case you are not satisfied with the grade of your submission). Please note that the final grade of the homework is based on the last submission.

Write a Review

Engineering Mathematics Questions & Answers

  Computer program to solve the problem of example

EXAMPLE: A project manager for a large earthmoving project is faced with the task of selecting the dozers to be used on a relatively remote project.

  What is the critical deviate for pca or duramorph situation

Calculate the t statistic for the above data (put final answer in blackboard and upload math) What is the critical deviate for the PCA/Duramorph situation

  Write a taylor series expansion

Apply the explicit integration method for the numerical solution of the 1D Poisson equations (that includes the free carriers) by following the steps outlined below: Write a Taylor series expansion for ψ(x) around x=0, keeping the terms up to the f..

  How large is the inflation tax for the two countries

The inflation tax is often used as a significant source of revenue in developing countries where the tax collection and reporting system is not well developed.

  Define black-scholes option pricing formula

Use the Black-Scholes option pricing formula to calculate the call option price after four months. Use s= ln u/sqrt(?t) with u is the up-factor and ?t = 1/12.

  Minimizing accident frequency and constitute progress

Determine the solution that will best achieve the company's goals in minimizing accident frequency and constitute progress toward satisfying OSHA compliance levels.  Interpret the solution results including the levels of goal achievement.

  Calculating the fourier transform of the product

Part 2: In this part we will again be multiplying two functions and calculating the Fourier Transform of the product. The first function is y1(t) = cos(20πt).

  Determine the cost basis of the three cells

A manufacturer of aerospace products purchased three flexible assembly cells for $500,000 each. Delivery and insurance charges were $35,000, and installation.

  Accumulated the data in the following table

The Hartley-Davis motorcycle dealer in the Minneapolis- St. Paul area wants to be able to forecast accurately the demand for the Roadhog Super motorcycle during the next month. From sales records, the dealer has accumulated the data in the followi..

  Find policy that maximize infinite horizon discounted reward

EE 556 Homework. Consider a discounted cost problem with the following parameters: Find a policy that maximizes infinite horizon discounted reward

  Explain difference between descriptive statistics

In your answer also describe and explain the difference between descriptive statistics and inferential statistics.

  Prove that the price of a barrier option implied by a tree

Prove that the price of a barrier option implied by a tree will always be less than the price of a vanilla option with the same parameters priced on the same tree.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd