Eric Zivot
CFRM 462/Econ 424
Summer 2014
Problem Set #2
Working with Random Variables and Probability Distributions
Suggested Solutions
Readings
My lecture notes on review of probability theory and random variables.
A Beginner’s Guide to R, chapters 3-7.
R Cookbook, chapters 8 (probability) and 10 (graphics)
Ruppert, chapter 2 (Returns).
Programs and Data
probReview.xls (on class syllabus and homework pages)
probReview.r (on class syllabus and homework pages)
Instructions
In this lab you will become more familiar with random variables and probability
distributions. Try to do all of the calculations and plots in R. You can also do everything
in Excel too. You will find the examples in probReview.R and probReview.xls to be
helpful for some of the exercises that follow.
Exercises
1.
Suppose X is a normally distributed random variable with mean 0.05 and variance
(0.10)
2
.
Compute the following
Pr(X > 0.10)
Pr(X < -0.10)
Pr(-0.05 < X < 0.15)
1% quantile, q
.01
5% quantile, q
.05
95% quantile q
.95
99% quantile, q
.99
# X ~ N(0.05, (0.10)^2)
> mu.x = 0.05
> sigma.x = 0.10
# Pr(X > 0.10)
> 1 - pnorm(0.10, mu.x, sigma.x)
[1] 0.3085

** Subscribe** to view the full document.