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:
≥100
≥110
≥120.
#Answer
(a). Probability of having value higher than or equal to q in a normal distribution with mean of 0 and sd of \(\sigma\)
m <- 0
sd<- sqrt(0.25)
n <- 365-1
q <- 0-m/sqrt(n)
pnorm(q, m, sd, lower.tail = FALSE)
## [1] 0.5
(b). Probability of having a value higher than or equal to q in a normal distribution with mean of 0 and sd of \(\sigma\)
q <- 10/sqrt(n)
pnorm(q, m, sd, lower.tail = FALSE)
## [1] 0.1472537
(c). Probability of having a value of higher than or equal to q in a normal distribution with mean of 0 and sd of \(\sigma\)
q <- 20/sqrt(n)
pnorm(q, m, sd, lower.tail = FALSE)
## [1] 0.01801584
Calculate the expected value and variance of the binomial distribution using the moment generating function.
Formula for Moment Generating Function for Binomial Distribution.
\(B_{n,p}\) binomial distribuion for variable X. Then the moment generating function is \(M(t)= (pe^{t}+(1-p))^{n}\)
Expected Value is the 1st derivative.
\(M'(t)=n(pe^{t}+(1-p))^{n-1}pe\)
\(E(X)=M'(0)=np\)
Variance is the 2nd derivative.
\(M''(t)=n((1-p)+pe^{t})^{n-1}(pe^{t})n(n-1)(1-p^{t}pe^{t})(pe^{t})\)
\(E(X^2)=M''(0)=n(n-1)p^{2}+np\)
\(Var(X)= E(X^2)-E(X)^2\)
\(=n(n-1)p^2+np-(np)^{2}\)
\(=(np^2)-np^2+np-np^2\)
\(=np(1-p)\)
Calculate the expected value and variance of the exponential distribution using the moment generating function.
Moment Generating Function for Exponentional distribution is
\(M(t)=\lambda/(\lambda-t)\)
Expected value is the 1st derivative.
\(M'(t)=\lambda/(\lambda-t)^2\)
\(E(X)=M'(0)=1/\lambda\)
Variance is the 2nd derivative
\(M''(t)=2\lambda/(\lambda-t)^{3}\)
\(E(X^2)=M''(0)=2/\lambda^2\)
\(Var(X)=E(X^2)-E(X)^2\)
\(=2/\lambda^2-1/\lambda^2\)
\(=1/\lambda^2\)