请浏览后下载,资料供参考,期待您的好评与关注!
#5.1
x
y
e=sum(x*y)/sum(y) #
样本期望
d=(sum(x*x*y)/sum(y))-e^2
#
样本方差
a=(8*e+sqrt(64*e^2-4*4*(4*e^2-12*d)))/
8
#
估计结果
b=(8*e-sqrt(64*e^2-4*4*(4*e^2-12*d)))/
8
a
b
#5.2
x
y
e=2.718281828459
f
λ
)(e^(-50*
λ
)*
λ
^50)/(2^10*6^2*24) #
似然函数
optimize(f,c(0,2),maximum=TRUE)
#5.3
x
#0.95
置信区间
t.test(x)$conf.int
chisq.var.test
options(digits=4)
result
n
v
result$var
chi2
result$chi2
p
result$p.value
if(alternative=="less")
result$p.value
else if (alternative=="two.sider")
result$p.value
result$conf.int
(n-1)*v/qchisq(alpha/
2,df=n-1,lower.tail=F),
(n-1)*v/qchisq(alpha/
2,df=n-1,lower.tail=T)
)
result
}
chisq.var.test(x,var(x),0.90,alternative="two.side")$conf.int
#0.90
置信区间
#5.4
x