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 \(X_n = Y_{n+1} − Y_n\) appear to be independent random variables with a common distribution having mean μ = 0 and variance \(\sigma^2 = 1/4\). If \(Y_1 = 100\), estimate the probability that \(Y_{365}\) is
Given:
\(Y_1 = 100\)
\(\sigma^2 = 1/4\)
\(\mu = 0\)
\(X_n = Y_{n+1} - Y_n\) => \(Y_{n+1} = X_n + Y_n\)
For n=364: \(Y_{365} = X_{364} + Y_{364} = Y_1 + \sum_{i=1}^{364}X_i = \bar x + Y_1\)
Variance: \(V(Y_{365}) = 365 * \sigma^2 = 365 \times \frac{1}{4} = 91.25\)
x <- 0; mu <- 0; sd <- sqrt(365/4)
cat(sprintf("%s = %f \n", c("P(Y365 ≥ 100)"), c(1 - pnorm(x, mean = mu, sd = sd, lower.tail = TRUE))))
## P(Y365 ≥ 100) = 0.500000
x <- 10; mu <- 0; sd <- sqrt(365/4)
cat(sprintf("%s = %f \n", c("P(Y365 ≥ 110)"), c(1 - pnorm(x, mean = mu, sd = sd, lower.tail = TRUE))))
## P(Y365 ≥ 110) = 0.147585
x <- 20; mu <- 0; sd <- sqrt(365/4)
cat(sprintf("%s = %f \n", c("P(Y365 ≥ 120)"), c(1 - pnorm(x, mean = mu, sd = sd, lower.tail = TRUE))))
## P(Y365 ≥ 120) = 0.018144
Moment generating function: \[g(t) = E(e^{tx}) = \sum^n_{x=0} e^{tx}f(x)\]
Binomial Distribution function: \[f(x) = \left( \begin{array}{c} n \\ x \end{array} \right) p^x(1-p)^{n-x}\]
\(g(t) = \sum^n_{j=0} e^{tx}\left( \begin{array}{c} n \\ x \end{array} \right) p^x(1-p)^{n-x} = \sum^n_{j=0} \left( \begin{array}{c} n \\ x \end{array} \right) (pe^t)^x(1-p)^{n-x} = (1-p + pe^t)^n\)
1st derivative, let’s find the expected value E(X):
\(g'(t) = \frac{dg}{dt} = npe^t( 1 - p + pe^t)^{n-1}\)
At t = 0 => \(E(X) = \frac{dg(0)}{dt} = np((1-p) + p)^{n-1} = np\)
2nd derivative, let’s find variance V(X):
\(g''(t) = \frac{d^2M_x(t)}{dt^2} = npe^t((n-1)(1 - p + pe^t)^{n-2}pe^t) + g'(t)\)
At t = 0 => \(E(X^2) = g''(0) = np(n-1)[1-p+pe^0]^{n-2}pe^0e^0 + g'(t) = np^2(n-1) + g'(t) = np^2(n-1) + np\)
\(V(X) = E(X^2) - (E(X))^2 = np^2(n-1) + np - n^2p^2 = n^2p^2 -np^2 +np - n^2p^2 = np - np^2 = np(1-p)\)
Moment generating function: \[g(t) = E(e^{tx}) = \sum^\infty_{x=0} e^{tx}f(x)\]
Exponential distribution function: \[f(x) = \lambda e^{-\lambda x}\]
\(g(t) = \int_{0}^{\infty} e^{tx}\lambda e^{-\lambda x} dx = \lambda \int_{0}^{\infty}e^{(t-\lambda) x} dx = \frac{\lambda}{t-\lambda}\)
1st derivative, let’s find the expected value E(X):
\(g'(t) = \frac{\lambda}{(\lambda - t)^2}\)
At t = 0 => \(E(X) = g'(0) = \frac{\lambda}{(\lambda)^2} = \frac{1}{\lambda}\)
2nd derivative, let’s find variance V(X):
\(g''(t) = \frac{2\lambda}{(\lambda - t)^3}\)
At t = 0 => \(E(X^2) = g''(0) = \frac{2\lambda}{\lambda^3} = \frac{2}{\lambda^2}\)
\(V(X) = E(X^2) - (E(X))^2 = \frac{2}{\lambda^2} - \frac{1}{\lambda^2} = \frac{1}{\lambda^2}\)