Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

ESE 4261 Statistical Methods for Data Analysis with Applications to Financial Engineering

EXAM 1 - Sample

Total:  50 points (each problem is 10 points worth)

Instructions:

1. You must show all work to completely justify your answers in order to receive any credit.

Problem  1.  The goal of this problem is to design and use a home-grown random number generator for the exponential distribution.  We recall that the pdf of that distribution is given by f(x) = λe−λ北 ,x > 0, where λ > 0 is the parameter.

a) You are not allow here to use any of the functions dexp , pexp , qexp and obviously rexp . Write an R function myrexp which takes the parameters N, and LAMBDA, and which returns a nu- meric vector of length N containing randomly sampled values from the exponential distribution with parameter LAMBDA.

b) Use your function  myrexp  to generate a sample of size N  =  1, 024 from the exponential distribution with mean  1.5,  use the R function  rexp  to generate a sample of size 2N  from the same distribution,  and produce a Q-Q plot of two samples.   Are you satisfied with the performance of your simuation function myrexp? Explain why.

Problem 2. This problem deals with the analysis of the daily S&P 500 index closing values. Recall that the corresponding file in the Rsafd library is DSP file.

a) Create a vector DSPRET containing the daily raw returns.  Recall that the raw return on a given day is the difference between the value on that day and the day before divided by the value on the previous day. Compute the mean and the variance of this daily raw return vector.

b) Fit a GPD to the daily raw returns, give detailed plots of the fit in the two tails, and discuss your results.

c) Generate a sample of size 10,000 from the GPD fitted above.  Call this sample SDPSRET, produce a Q-Q plot of DSPRET against SDPSRET, and comment.

Problem 3. This problem is based on the data contained in the data set SPFUT in Rsafd library. The first column gives, for each day, the log return of a futures contract which matures 3 weeks later, (we’ll call that variable X), and the second column gives, on the same day, the log return of a futures contract which matures 1 week later (we’ll call it variable Y).

a) Compute the means and the standard deviations of X and Y , and compute their correlation coefficient.

b) Assume here that X and Y are samples from a jointly Gaussian distribution with parameters computed in a). For the value of α = 25%, compute the q-percentile with q = 2% of the variable αX + (1 − α)Y .

c) Create corresponding Q-Q plots to assess if samples from variables X and Y have heavy tails.

Problem 4. Assume that X is a random variable uniformly distributed over the unit interval [0, 1] and let us define the new random variable Y as

Y = 1 − |2X − 1|.

Compute the covariance cov(X,Y) of X and Y . Recall that cov(X,Y) = E(XY) − E(X)E(Y).

Problem 5.  This problem is intended to give an example showing that lack of correlation does not necessarily mean independence.

Assume that X ∼ N(0, 1) and let us define the random variable Y by

Y =  (|X| −^2/π).

a) Compute E(|X|).

b) Show that Y has mean zero, variance 1, and that it is uncorrelated with X .