$30
ECON 424 Homework 4
Readings
• EZ class slides and book chapters on descriptive statistics, CER model and CER
model estimation.
• Ruppert chapter 4 (Exploratory data analysis)
• PerformanceAnalytics and zoo vignettes
• Introduction to the corrplot package: http://cran.rproject.org/web/packages/corrplot/vignettes/intro.html
Programs and Data
The following files are located on the class homework page:
• Econ424lab4.r - R script file hints for lab
• descriptiveStatistics.Rmd - R markdown file used for class examples
• CERmodel.Rmd - R markdown file used for class examples
• CERmodelEstimation.Rmd - R markdown file used for class examples
1
Instructions
In this lab you will use R to:
• Compute univariate, bivariate and time series descriptive statistics
• Estimate parameters of the constant expected return (CER) model, compute
standard errors and confidence intervals
Exercises
The following questions require R. On the class Canvas page are the script files econ424lab4.r,
and R markdown files descriptiveStatistics.Rmd and CERmodel.Rmd and CERmodelEstimation.Rmd. The former contains hints for completing the assignment, and the
latter files contain the code for doing the examples from class. As in lab 3, copy and
paste all statistical results and graphs into a MS Word document while you work (and
add any comments and answer all questions in this document) or create an R markdown file. Please do not turn in the assignment without comments!
In this lab, you will analyze continuously compounded monthly return data on the
Vanguard long term bond index fund (VBLTX), Fidelity Magellan stock mutual fund
(FMAGX), and Starbucks stock (SBUX). I encourage you to go to finance.yahoo.com
and research these assets. The script file econ424lab4.r walks you through all of the
computations for the lab. You do not need to show the R commands in your lab write
up. You will use the get.hist.quote() function from the tseries package to automatically
load this data into R. You will also use several functions from the PerformanceAnalytics package. Remember to install packages before you load them into R.
1. Part I: Descriptive Statistics
I. Historical VaR
1) For each asset compute the empirical 1% and 5% quantiles of the cc returns. Using
these quantiles compute the 1% and 5% historical (monthly) VaR values based on an
2
initial $100,000 investment. Which asset has the highest and lowest VaR values? Are
you surprised?
II. Bivariate Graphical Analysis
1) Use the R pairs() function to create all pair-wise scatterplots of returns Comment
on the direction and strength of the linear relationships in these plots.
2) Use the functions corrplot() and corrplot.mixed() in the R package corrplot, plot
the correlation matrix of the returns on the three assets.
III. Bivariate Numerical Summary Statistics
Use the R functions var(), cov(), and cor() to compute the sample covariance matrix
and sample correlation matrix of the returns. Comment on the direction and strength
of the linear relationships suggested by the values of the covariances and correlations.
IV. Time Series Summary Statistics
Use the R function acf() to compute and plot the sample autocorrelation functions of
each return. Do the returns appear to be uncorrelated over time?
2. Constant Expected Return Model
Consider the constant expected return model (CER):
Rit = µi + it, t = 1, ..., T
it ∼ iid N(0, σ2
i
)
cov(it, jt) = σij
where Rit denotes the continuously compounded return on asset i, i =Vanguard long
term bond index fund (VBLTX), Fidelity Magellan stock mutual fund (FMAGX), and
3
Starbucks stock (SBUX).
(a) Using sample descriptive statistics, give estimates for the model parameters µi
, σ2
i
, σi
, σij , ρij
. Arrange these estimates nicely in a table. Briefly comment. Hint: you already computed these estimates in Part I. Just put them in a table.
(b) For each estimate of the above parameters (except σij ) compute the estimated
standard error. That is, compute SE( ˆµi), SE(
ˆσ
2
i
), SE( ˆσi), andSE( ˆρij ) Briefly comment on the precision of the estimates. Hint: the formulas for these standard errors
were given in class, and are given in the lecture notes on the constant expected return
model.
(c) For each parameter µi
, σ2
i
, σi
, andρij compute 95% and 99% confidence intervals.
Briefly comment on the width of these intervals.
(d) Using the estimated values of µi
, σ2
i
for each mutual fund, compute the normal
distribution 1% and 5% monthly value-at-Risk (VaR) based on an initial $100,000
investment. Compare these values with the historical VaR values computed earlier.
4