11 page:363
The price of one share of stock in the Pilsdorff Beer Company (see Exercise 8.2.12) is given by \(Y_n\) on the \(n\)th day of the year. Finn observes that the differences \(X_n = Y_{n+1}-Y_n\) appear to be independent random variables with a common distribution having mean $ = 0$ and variance \(\sigma^2 = \frac{1}{4}\). If \(Y_1 = 100\), estimate the probability that \(Y_365\) is
\(\geq 100\).
y <- 100
y1 <- 100
n <- 365
variance <- sqrt(n)/2
mu <- 0
geq100 <- pnorm(y-y1, mu, variance, lower.tail = FALSE)
cat("The prob. that the price of Pilsdorff stock on day 365 is greater than 100 is :",geq100)
## The prob. that the price of Pilsdorff stock on day 365 is greater than 100 is : 0.5
\(\geq 110\).
y <- 110
y1 <- 100
n <- 365
variance <- sqrt(n)/2
mu <- 0
geq100 <- pnorm(y-y1, mu, variance, lower.tail = FALSE)
cat("The prob. that the price of Pilsdorff stock on day 365 is greater than 100 is :",geq100)
## The prob. that the price of Pilsdorff stock on day 365 is greater than 100 is : 0.1475849
y <- 120
y1 <- 100
n <- 365
variance <- sqrt(n)/2
mu <- 0
geq100 <- pnorm(y-y1, mu, variance, lower.tail = FALSE)
cat("The prob. that the price of Pilsdorff stock on day 365 is greater than 100 is :",geq100)
## The prob. that the price of Pilsdorff stock on day 365 is greater than 100 is : 0.01814355
Calculate the expected value and variance of the binomial distribution using the moment generating function.
Moment Generation Function: Binomial Distribution
Binomial Dist: \(g(t) = (1-p+pe^t)^n = (q+pe^t)^n\)
Getting the expected value of the binomial distribution requires the use of the first derivative when \(t = 0\):
So: \[g^{'}(t=0) = n(q+pe^t)^{n-1}pe^t\]
\[g^{'}(t=0) = n(q+pe^0)^{n-1}pe^0\]
Note that \(e^0=1\)
\[=n(q+p)^{n-1}p\] \[=n(1)^{n-1}p\] Lastly:
\[g^{'}(t=0)=np\]
Variance should be equal to the second derivative - the first derivative:
\[\sigma^2=g^{''}(0)-g^{'}(0)^2= np^2(n-1)+np-np^2=np-np^2=np(1-p)|npq\]
Calculate the expected value and variance of the exponential distribution using the moment generating function
Exponential Distribution: \[\lambda e^{\lambda x}\]
The MGF for the exponential dist would be:
\[g(t)=\lambda(-1)(\lambda-t)^-2 (-1)\] \[=\lambda(\lambda-t)^-2\]
\[g(t)=\frac{\lambda}{(\lambda - t)^2}\]
Thus, the first derivative of the MGF is as follows, when \(t=0\):
\[g^{'}(0)=\frac{1}{\lambda} \\or \\\ \lambda^{-1}\] Moving to the second derivative for finding Var:
\[g^{''}(t)=\frac{2 \lambda}{(\lambda-t)^3}\] When t=0:
\[g^{''}(t)=\frac{2 \lambda}{(\lambda)^3}= \frac{2}{\lambda^2}\]
Lastly:
Using: \[\sigma^2=g^{''}(0)-g^{'}(0)^2\]
\[\sigma^2 = \frac{2}{\lambda^2} - \frac{1}{\lambda^2}= \frac{1}{\lambda^2}\] or \[\lambda^{-2}\]