您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 质量控制/管理 > 数据的基本统计分析方法
1安徽财经大学统计与数学模型分析实验中心《数学软件》实验报告实验名称:数据的基本统计分析使用软件:Matlab实验目的熟练掌握数据的基本统计分析方法实验内容(具体题目及程序)1.已知)5.0,2(~2NX,试求:3XP,21XP2.若X~N(2,4),作出X在[-1,3]上的曲线3.已知数据:4593626245425095844337488155056124524349826407425657065936809266531644877346084281153593844527552513781474388824538862659775859755649697515628954771609402960885610292837473677358638699634555570844166061062484120447654564339280246687539790581621724531512577496468499544645764558378765666763217715310851计算该数据特征.4.判别题3中的数据有无异常值。5.下表给出了15种资产的收益率ri(%)和风险损失率qi(%),计算峰度与偏度.Siri(%)qi(%)Siri(%)qi(%)S19.642S933.653.3S218.554S1036.840S349.460S1111.831S423.942S1295.5S58.11.2S133546S61439S149.45.3S740.768S151523S831.233.46.作出题3数据的直方图,该数据服从正态分布还是威布尔分布?程序如下:1.2normcdf(3,2,0.5)normcdf(2,2,0.5)-normcdf(1,2,0.5)2.normspec([-1,3],2,2)3.a=[4593626245425095844337488155056124524349826407425657065936809266531644877346084281153593844527552513781474388824538862659775859755649697515628954771609402960885610292837473677358638699634555570844166061062484120447654564339280246687539790581621724531512577496468499544645764558378765666763217715310851];b=a(:);T=[mean(b),median(b),trimmean(b,10),geomean(b),harmmean(b),range(b),var(b),std(b),iqr(b),mad(b)]4.a=[4593626245425095844337488155056124524349826407425657065936809266531644877346084281153593844527552513781474388824538862659775859755649697515628954771609402960885610292837473677358638699634555570844166061062484120447654564339280246687539790581621724531512577496468499544645764558378765666763217715310851];x=sort(a(:))5.x=[9.6,18.5,49.4,23.9,8.1,14,40.7,31.2,33.6,36.8,11.8,9,35,9.4,15];y=[42,54,60,42,1.2,39,68,33.4,53.3,40,31,5.5,46,5.3,23];sx=skewness(x)kx=kurtosis(x)sy=skewness(y)3ky=kurtosis(y)6.a=[4593626245425095844337488155056124524349826407425657065936809266531644877346084281153593844527552513781474388824538862659775859755649697515628954771609402960885610292837473677358638699634555570844166061062484120447654564339280246687539790581621724531512577496468499544645764558378765666763217715310851];hist(a(:),30);normplot(a(:))4实验结果分析1.ans=0.9772ans=0.4772所以分布函数与概率密度函数值为normcdf(3,2,0.5)=0.9772normcdf(2,2,0.5)-normcdf(1,2,0.5)=0.47722.正态密度曲线如下:-6-4-2024681000.020.040.060.080.10.120.140.160.180.2ProbabilityBetweenLimitsis0.62466DensityCriticalValue3.T=1.0e+004*Columns1through90.06000.06000.06010.05600.04990.10693.86630.01970.0244Column100.0151位置特征计算结果变异特征计算结果算术平均600极差1069中位数599.5方差38663.03切尾平均600.64标准差196.629几何平均559.68四分位极差243.5调和平均499.06平均绝对偏差150.8654.x=8412016421724628029231033935836237838840241642843343444745245946847347448448749649950565095125135155275315385395425445525555585645655705775815845935936066086096106126216246286346387640645649653654659666677680687697699706715724734742748755763764765771775781790815824837844851885986288592695496098210621153得到原数据从小到大的次序统计量,因为np为整数,故有:下四分位数为:Q1=(x(25)+x(26))/2=485.5上四分位数为:Q3=(x(75)+x(76))/2=729四分位极差为:R=243.5数据的下、上截断点分别为:Q1-1.5R=120.25,Q3+1.5R=1094.25由此可知:80,120,1153是异常值5.sx=0.4624kx=1.8547sy=-0.4215ky=2.2506sx=skewness(x)=0.4624,kx=kurtosis(x)=1.8547,sy=skewness(y)=-0.4215,ky=kurtosis(y)=2.2506从计算结果可知:收益率是正偏,而风险损失率为负偏;二者峰度都小于3属于平阔峰.96.020040060080010001200012345678910从直方图发现数据比较接近于正态分布,用命令normplot(a(:))进行检验.100200300400500600700800900100011000.0030.010.020.050.100.250.500.750.900.950.980.990.997DataProbabilityNormalProbabilityPlot从图中可见数据点基本上都位于直线上,故可认为该数据服从正态分布,由于已经计算出该数据的均值为600,标准差为196.629,所以数据服从)629.196,600(2N结果分析:写出上述实验中所需用到的Matlab命令,以及命令中应注意的问题分布函数的命令为:P=normcdf(x,mu,sigma)已知X的均值和标准差及概率p=P{Xx},求x的命令为:X=norminv(P,MU,SIGMA)算术平均mean极差range中位数median方差var切尾平均trimmean标准差std几何平均geomean四分位极差iqr调和平均harmmean平均绝对偏差mad10n阶中心矩峰度系数偏度系数变异系数moment(x,n)kurtosis(x)skewness(x)std(x)./abs(mean(x))直方图的命令:格式:hist(data,k).说明:data是原始数据,该命令将区间(min(data),概率纸检验函数的命令:normplot(data)成绩
本文标题:数据的基本统计分析方法
链接地址:https://www.777doc.com/doc-2429013 .html