HW9
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 \({\mu}\) = 0 and variance \({\sigma^2}\) = 1/4. If Y1 = 100, estimate the probability that Y365 is
f<-function(y2)
{
m <- 0
s <- .25
y<-100
x <- 365
s2 = x*sqrt(s)
z<- (y-y2)/s2
pnorm(z)
}a<-f(100)The probablilty of Y365 >= 100 is 0.5
b<-f(110)The probablilty of Y365 >= 110 is 0.48
c<-f(120)The probablilty of Y365 >= 120 is 0.46
Calculate the expected value and variance of the binomial distribution using the moment generating function.
Binomial MGF = \({[pe^t+ (1-p)]^n}\)
amgf <- (a*(log(exp(365))+ (1-a)))^1
bmgf <- (b*(log(exp(365))+ (1-b)))^1
cmgf <- (c*(log(exp(365))+ (1-c)))^1
mmgf <- mean(c(amgf,bmgf,cmgf))
smgf <- var(c(amgf,bmgf,cmgf))The expected value of the binomial distirbution is 174.78 and the variance is 63.42
Calculate the expected value and variance of the exponential distribution using the moment generating function.
eamgf<-1/a*100
ebmgf<-1/b*110
ecmgf<-1/c*120
emmgf<-mean(c(eamgf,ebmgf,ecmgf))
samgf<-((100-eamgf)^2)/100
sbmgf<-((110-ebmgf)^2)/110
scmgf<-((120-ecmgf)^2)/120
smmgf<-mean(c(samgf,sbmgf,scmgf))The expected value of the exponential distribution is 231 and the variance is 133.77