程序:
x=[506,503,499,505,510,498,496,502,507,501]
[a,b,ar,br]=normfit(x,1-0.95) %a为总体均值,b为标准差,ar为总体均值置信区间,br为标准差置信区间
结果:
x = 506 503 499 505 510 498 496 502 507 501
a = 502.7000
b = 4.3729
ar =
499.5718
505.8282
br =
3.0078
7.9832
程序:
%问题一
p1=1-binocdf(1,1000,0.005)
%问题二
p2=binocdf(10,1000,0.005)
%问题三
n=binocdf(0.95,1000,0.005)
结果:
p1 = 0.9599
p2 = 0.9865
n = 0.0067
程序:
p=poisscdf(8000*0.21,8000*0.20)-poisscdf(8000*0.19,8000*0.20)
结果:
p = 0.9545
程序:
%问题一
p1=normcdf(3,5,4)
p2=normcdf(3,5,4)-normcdf(1,5,4)
%问题二
a=norminv(0.5,5,4) %P(X<a)=P(X<a)=0.5,即a所在位置是在正态分布图的中点
%问题三
x=-1:0.5:11;
y=normpdf(x,5,2);
plot(x,y)
结果:
p1 = 0.3085
p2 = 0.1499
a = 5
程序:
x=[506,503,499,505,510,498,496,502,507,501]
mean=mean(x) %均值
var=var(x,1) %方差
std=std(x,1) %标准差
median=median(x) %中位数
mode=mode(x) %众数
max=max(x) %最大值
min=min(x) %最小值
range=range(x) %极差
skewness=skewness(x) %偏度
kurtosis=kurtosis(x) %峰度
[n,y]=hist(x,5) %频数表
结果:
x = 506 503 499 505 510 498 496 502 507 501
mean = 502.7000
var = 17.2100
std = 4.1485
median = 502.5000
mode = 496
max = 510
min = 496
range = 14
skewness = 0.0787
kurtosis = 2.0350
n = 2 2 2 3 1
y = 497.4000 500.2000 503.0000 505.8000 508.6000
程序:
x=[0.497,0.496,0.503,0.501,0.499,0.496,0.502,0.507,0.500,0.498];
[h,p,mr,z]=ztest(x,0.5,0.01,0.05,0)
%假设检验的格式为:[h,p,mr,z]=ztest(x,mean,sigma,alpha,tail)
%x:检验数据
%mean:原假设的均值μ
%sigma:标准差σ
%alpha:显著性水平α
%tail:确定假设的情况
%当tail=0时,表示检验假设“总体的均值为μ”;
%当tail=1时,表示检验假设“总体的均值大于μ”;
%当tail=-1时,表示检验假设“总体的均值小于μ”
h=0接受原假设,h=1拒绝原假设
结果:
h = 0 %接受原假设,生产正常
p = 0.9748 %检验假设成立的概率
mr = 0.4937 0.5061 %均值的置信区间
z = -0.0316 %统计量的值
免责声明:本文系网络转载或改编,未找到原创作者,版权归原作者所有。如涉及版权,请联系删