The price of one share of stock in the Pilsdorff Beer Company (see Exer- cise 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
\(\sigma= \sqrt{n \sigma^2}\)
std_dev <- sqrt(365 * (1/4))
pnorm(100-100,0,sd=std_dev,lower.tail = F)
## [1] 0.5
pnorm(110-100,0,sd=std_dev,lower.tail = F)
## [1] 0.1475849
pnorm(120-100,0,sd=std_dev,lower.tail = F)
## [1] 0.01814355
Calculate the expected value and variance of the binomial distribution using the moment generating function. Helpful link working through the proof steps a bit more detailed than the textbook
\(B(n,p,j) = \binom{n}{j}q^{n-x}p^x\)
\(\sum_{x = 0}^{n} e^{xt}\binom{n}{j}q^{n-x}p^x\)
\(\sum_{x = 0}^{n} (pe^t)^x \binom{n}{j}q^{n-x}\)
\((pe^t + q)^n\)
Taking the first derivative of the moment
\(\frac{dGt}{dt} = n(pe^tq)^{n-1}pe^t\)
\(g'(t) = n(pe^0+q)^{n-1}pe^0 = np(p+q)^{n-1}\)
\(g'(t) = np(1)^{n-1} = np\)
\(g''(t) = n(q+pe^t)^{n-1}(pe^t)+pe^tn(n-1)(q+pe^t)^{n-2}pe^t\)
\(g''(t) = n(1-p+pe^0)^{n-1}(pe^t)+pe^tn(n-1)[1-p+pe^0]^{n-2}pe^0\)
\(g''(t) = n(1)^{n-1}(p)+pn(n-1)1^{n-2}p = np + n^2p^2 - np^2\)
\(\sigma^2 = g''(t) - g'(t)^2 = \space np + n^2p^2 - np^{2} - (np)^2 = np(1-p)\)
Calculate the expected value and variance of the exponential distribution using the moment generating function.
Helpful to see the steps listed in this example
\(g(t) = \frac{1}{1-\lambda t} = (1-\lambda t)^{-1}\)
\(\mu = g'(t) = -(1-\lambda t)^{-2}(-\lambda)\)
\(\mu = g'(t) = -(1-0)^{-2}(-\lambda) = \lambda\)
\(g''(t) = -2\lambda(1-\lambda t)^{-3} (-\lambda) | t=0 = \lambda * -2(1-0)^{-3}(-\lambda)\)
\(g''(t) = 2\lambda^2\)
\(\sigma^2 = g''(t) - g'(t)^2 = 2\lambda^2 - \lambda^2 = \lambda ^2\)