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:
var <- 365*0.25
stdev <- sqrt(var)
p <- 1 - pnorm(0,0,stdev)
print(paste0("Probability a: ", round(p,3)))
## [1] "Probability a: 0.5"
p <- 1 - pnorm(10,0,stdev)
print(paste0("Probability b: ", round(p,3)))
## [1] "Probability b: 0.148"
p <- 1 - pnorm(20,0,stdev)
print(paste0("Probability c: ", round(p,3)))
## [1] "Probability c: 0.018"
Calculate the expected value and variance of the binomial distribution using the moment generating function.
On page 367 of the textbook they go through Example 10.2 which calculates the expected value and variance of the binomial distribution using the moment generating function. Below the exercise is rewritten.
“Suppose now that X has range {0, 1, 2, 3, . . ., n} and
$$ p_X(j) = ( \[\begin{array}{c}n\\j\end{array}\])pjq{n-j}
$$
for 0 ≤ j ≤ n (binomial distribution). Then:
$$ g(t) = _{j=0}{n}e{tj} ( \[\begin{array}{c}n\\j\end{array}\]) pjq{n-j}
\ g(t) = _{j=0}^{n} ( \[\begin{array}{c}n\\j\end{array}\]) (pet)j q^{n-j}
\ g(t) = (pe^t +q)^n
$$ Note that
$$
µ_1 = g’(0) = n(pe^t + q){n−1}pet|_{t=0} = np
\ µ_2 = g’’(0) = n(n − 1)p^2 + np
$$
so that
\[ u = u_1 = np \ and \\ \sigma^2 = u_2 - u_1^2 = np(1-p) \] as expected.”
Calculate the expected value and variance of the exponential distribution using the moment generating function.
So we can follow along with how we solved question 2, but rather than the binomial distribution we will use the exponential distribution.
The PDF is:
$$ f(x) = e ^ {-x}
\
g(t) = _{0}{}e{tx} e ^ {-x} dx
\ g(t) = /(- t) $$
Ultimately we find:
$$ u = 1/\
^ 2 = 1/^2 $$