自助统计量-sapui5(sap fiori)开发工具介绍
3.7自助统计量用bootstrp函数计算重复取样的自助统计量。其调用格式和描述为: bootstrp(nboot, 'bootfun', d1,...)绘nboot个自助数据样本并用bootfun函数分析它们。 nboot必须为正整数。bootstrp函数将数据d1、d2等传递给bootfun函数。 [bootstat, bootsam] = bootstrap(...)在bootstat参数中返回自助统计量。bootstat的每一行包括对一个自助样本应用‘bootfun’得到的结果。若‘bootfun’返回一个矩阵,则该输出转换为一个长向量,以保存在bootstat中。bootsam为一指数矩阵。 【例3-14】已知15个学生的LSAT分数和法学院GPA。通过对这15个数据点进行重复采样,创建了1000个不同的数据集,计算每个数据集中两个变量之间的相关系数。 load lawdata [bootstat,bootsam] = bootstrp(1000,'corrcoef',lsat,gpa); bootstat(1:5,:) ans = 1.0000 0.3021 1.0000 0.6869 1.0000 0.8346 1.0000 0.8711 1.0000 0.8043 1.0000 bootsam(:,1:5) ans = 4 1 15 6 8 13 7 11 9 14 13 8 2 10 5 10 12 15 6 4 15 11 12 8 4 5 6 3 8 14 8 4 2 15 2 8 6 5
6.88MB
文件大小:
评论区