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
Repeating elements:
n = 365
y1 = 100
u = 0
u_y1 = u + y1
sd = sqrt(n * 1/4)
x1 = 100
pnorm(x1,u_y1,sd,lower.tail=F)
## [1] 0.5
x2 = 110
pnorm(x2,u_y1,sd,lower.tail=F)
## [1] 0.1475849
x3 = 120
pnorm(x3,u_y1,sd,lower.tail=F)
## [1] 0.01814355
Calculate the expected value and variance of the binomial distribution using the moment generating function.
Binomial function:
\[b(x;n,p) = \frac{n!}{x!(n - x)!}p^xq^{n-x}\] with \[q = 1 - p\]
The moment-generating function:
\[M_x(t) = \sum_{x=0} ^n e^{xt} \frac{n!}{x!(n - x)!}p^xq^{n-x} = \sum_{x=0} ^n (pe^{t})^x \frac{n!}{x!(n - x)!}q^{n-x} = (q + pe^t)^n\]
Differentiate with respect to \(t\) using function-of-function rule:
Evaluating at \(t = 0\) provides:
\[E(x) = np(q + p)^{n-1} = np\]
This is our expected value. To get variance, we need to get the second moment:
\[ \frac{d^2M_x(t)}{dt^2} = npe^t(q+pe^t)^{n-2}(q+npe^t) \]
We’ll need $E(x^2), so evaluate the above at \(t=0\):
\[E(x^2) = np(q + p)^{n-2}(q + np) = np(q + np)\]
Using the above:
\[V(x) = E(x^2) - E(x)^2) = np(q + np) - n^2p^2 = np(q + np) = n^2p^2 = npq\]
Which is our variance.
Calculate the expected value and variance of the exponential distribution using the moment generating function.
Exponential:
\[f(x) = \lambda e^{-\lambda x} \]
The moment-generating function for an exponential function with parameter \(\theta\):
\[M(t) = E(e^{tx}) = \int_0 ^{\infty} e^{tx} (\frac{1}{\theta})e^{-x/\theta}dx\]
Rewrite as a limit and integrating:
\[M(t) = \frac{1}{\theta} \lim_{b \mapsto \infty} (\frac{1}{t - 1/\theta}e^{x(t-1/\theta)})\]
from \(x = b\) to \(x = 0\).
Evaluating at x = 0 and x =b, we we end up with our moment-generating function:
\[M(t) = \frac{1}{1 - \theta t} \]
Can be rewritten as \(M_x(t) = \frac{\lambda}{t - \lambda}\). Assuming \(t < \lambda\).
Derivative of mgt:
\[= \frac{\lambda}{(\lambda - t)^2}\]
Expected value:
\[\frac{\lambda}{(\lambda - 0)^2} = \frac{1}{\lambda}\]
Variance:
First, we need second derivative of mgt:
\[\frac{2\lambda}{(\lambda - 0)^2} = \frac{2}{\lambda^2} \]
Then using expected value:
\[V(x) = E(x^2) - E(x)^2) = \frac{2}{\lambda^2} - \frac{1}{\lambda}^2 = \frac{1}{\lambda}^2\]
Sources:
https://www.thoughtco.com/moment-generating-function-binomial-distribution-3126454