Data 605 Assignment 9

11 Page 363

11 The price of one share of stock in the Pilsdorff Beer Company (see Exercise 8.2.12) is given by Yn on the nth day of the year. Finn observes that the differences Xn = Yn+1 − Yn appear to be independent random variables with a common distribution having mean µ = 0 and variance σ 2 = 1/4. If Y1 = 100, estimate the probability that Y365 is (a) ≥ 100. (b) ≥ 110. (c) ≥ 120.

mean <- 100  
var <- 1/4
sd <- sqrt(var*364)
n <- 364  
1 - pnorm(100,mean,sd, lower.tail=T)
## [1] 0.5
1 - pnorm(110,mean,sd)
## [1] 0.1472537
1 - pnorm(120,mean,sd)
## [1] 0.01801584

Calculate the expected value and variance of the binomial distribution using the moment generating function

\[P_X(j) = {n \choose j} p^j q^{n-j}\] where q = 1-p

Use the probability mass function to obtain the moment generating function of X:

\[g(t) = \sum_{j=0}^{n}n e^{tj}{n \choose j}p^jq^{n - j}\] \[g(t)=(q+pe^t)^n\]

The expected value is the first moment evaluated at t=0:

\[g^{'}(t)=n(pe^t + q)^{n-1}pe^t\] \[g^{'}(t)=np\]

The calculation of the variance is performed in a similar manner. First, differentiate the moment generating function again, and then we evaluate this derivative at t = 0

\[g^{''}(t)=n(n-1)p^2 + np\] ###The variance σ2 of your distribution is: \[\sigma^2 = g^{''}(0) - [g^{'}(0)]^2 = n(n - 1)p^2 +np - (np)^2 = np(1 - p)\]

Calculate the expected value and variance of the Expontential distribution using the moment generating function

For exponential distribution,

\[f(x)=\lambda e^{-\lambda x}\] ###The moment generating function is: \[M_X(t)=\frac{\lambda}{\lambda-t}, t<\lambda\]

\[M′X(t)=λ(λ−t)2 and M′′X(t)=2λ(λ−t)3.\]

Expected Value

\[\begin{split} E(X)=M'_X(0) &= \frac{\lambda}{(\lambda-0)^2} \ &= \frac{\lambda}{\lambda^2}\ &= \frac{1}{\lambda} \end{split}\]

Variance:

\[\begin{split} V(X) = E(X^2)-E(X)^2 &= M''_X(0)-M'_X(0)^2 \ &=\frac{2\lambda}{(\lambda-0)^3} - \frac{1}{\lambda^2}\ &=\frac{2\lambda}{\lambda^3} - \frac{1}{\lambda^2}\ &=\frac{2}{\lambda^2} - \frac{1}{\lambda^2}\ &=\frac{1}{\lambda^2} \end{split}\]

Corey Arnouts

March 31, 2019