收藏 分享(赏)

统计工具箱.ppt

上传人:天天快乐 文档编号:1484287 上传时间:2018-07-21 格式:PPT 页数:23 大小:131KB
下载 相关 举报
统计工具箱.ppt_第1页
第1页 / 共23页
统计工具箱.ppt_第2页
第2页 / 共23页
统计工具箱.ppt_第3页
第3页 / 共23页
统计工具箱.ppt_第4页
第4页 / 共23页
统计工具箱.ppt_第5页
第5页 / 共23页
点击查看更多>>
资源描述

1、,统计工具箱 基本统计量 常见概率分布的函数 参数估计 假设检验 方差分析与回归 综合实例,Mean函数,Syntax M = mean(A) M = mean(A,dim) Description M = mean(A) returns the mean values of the elements along different dimensions of an array. If A is a vector, mean(A) returns the mean value of A. If A is a matrix, mean(A) treats the columns of A as

2、vectors, returning a row vector of mean values. M = mean(A,dim) returns the mean values for elements along the dimension of A specified by scalar dim. For matrices, mean(A,2) is a column vector containing the mean value of each row.,Examples,A = 1 2 3; 3 3 6; 4 6 8; 4 7 7; mean(A) ans = 3.0000 4.500

3、0 6.0000 mean(A,2)ans = 2.0000 4.0000 6.0000 6.0000,离散型随机变量的E(X),求上述E(X)和E(3x2+5)的值。 x=-2 0 2 pk=0.4 0.3 0.3 sum(x.*pk) z=3*x.2+5 sum(z.*pk),其它求平均数的函数:,m = nanmean(X) returns the sample mean of a financial time series object X, treating NaNs as missing values. m is a row vector containing the mean v

4、alue of the non-NaN elements in each series. m = geomean(x) calculates the geometric mean of a sample. For vectors,geomean(x) is the geometric mean of the elements in x. For matrices,geomean(X) is a row vector containing the geometric means of each column. For N-dimensional arrays, geomean operates

5、along the first nonsingleton dimension of X.,m = harmmean(X) calculates the harmonic mean of a sample. For vectors, harmmean(x) is the harmonic mean of the elements in x. For matrices, harmm-ean(X) is a row vector containing the harmonic means of each column. For N-dimensional arrays, harmmean opera

6、tes along the first nonsingleton dimension of X.,m = trimmean(X,percent) calculates the trimmed mean of the values in X. For a vector input, m is the mean of X, excluding the highest and lowest k data values, where k=n*(percent/100)/2 and where n is the number of values in X. For a matrix input, m i

7、s a row vector containing the trimmed mean of each column of X.,数据比较,Max,min,median,mad,sort,sortrows,range. y = mad(X) returns the mean absolute deviation of the values in X. For vector input, y is mean(abs(X-mean(X). For a matrix input, y is a row vector containing the mean absolute deviation of e

8、ach column of X.,方差和标准差,Syntax V = var(X) V = var(X,1) V = var(X,w) V = var(X,w,dim) Description V = var(X) returns the variance of X for vectors. For matrices, var(X)is a row vector containing the variance of each column of X. For N-dimensional arrays, var operates along the first nonsingleton dime

9、nsion of X. The result V is an unbiased estimator of the variance of the population from which X is drawn, as long as X consists of independent, identically distributed samples. var normalizes V by N-1 if N1, where N is the sample size. This is an unbiased estimator of the variance of the population

10、 from which X is drawn, as long as X consists of independent, identically distributed samples. For N=1, V is normalized by N.,V = var(X,1) normalizes by N and produces the second moment of the sample about its mean.var(X,0) is equivalent to var(X). V = var(X,w) computes the variance using the weight

11、 vector w. The length of w must equal the length of the dimension over which var operates, and its elements must be nonnegative. The elements of w must be positive. var normalizes w to sum of 1. x=-1 -1 1 2; w=1 2 3 4;v4=var(x,w),V = var(X,w,dim) takes the variance along the dimension dim of X. Pass

12、 in 0 for w to use the default normalization by N-1, or 1 to use N. The variance is the square of the standard deviation (STD).,标准差:std,std - Standard deviation Syntax s = std(X) s = std(X,flag) s = std(X,flag,dim) Definition There are two common textbook definitions for the standard deviation s of

13、a data vector X.,and n is the number of elements in the sample.,Description,s = std(X), where X is a vector, returns the standard deviation using (1) above. The result s is the square root of an unbiased estimator of the variance of the population from which X is drawn, as long as X consists of inde

14、pendent, identically distributed samples. If X is a matrix, std(X) returns a row vector contain- ing the standard deviation of the elements of each column of X. If X is a multidimensional array, std(X) is the standard deviation of the elements along the first nonsingleton dimension of X.,s = std(X,f

15、lag) for flag = 0, is the same as std(X). For flag = 1, std(X,1) returns the standard deviation using (2) above, producing the second moment of the set of values about their mean. s = std(X,flag,dim) computes the standard deviations along the dimension of X specified by scalar dim. Set flag to 0 to

16、normalize Y by n-1; set flag to 1 to normalize by n.,Examples,For matrix X X = 1 5 9 7 15 22 s = std(X,0,1) s = 4.2426 7.0711 9.1924 s = std(X,0,2) s = 4.000 7.5056,偏度,峰度,skewness - Skewness Syntax y = skewness(X) y = skewness(X,flag),where is the mean of x, is the standard deviation of x, and E(t)

17、represents the expected value of the quantity t. skewness computes a sample version of this population value.,Description,y = skewness(X) returns the sample skewness of X. For vectors, skewness(x) is the skewness of the elements of x. For matrices, skewness(X) is a row vector containing the sample s

18、kewness of each column. For N-dimensional arrays, skewness operates along the first nonsingleton dimension of X.,y = skewness(X,flag) specifies whether to correct for bias (flag = 0) or not (flag = 1, the default). When X represents a sample from a population, the skewness of X is biased; that is, i

19、t will tend to differ from the population skewness by a systematic amount that depends on the size of the sample. You can set flag = 0 to correct for this systematic bias.,When you set flag to 1, the following equation applies:,When you set flag to 0, the following equation applies:,This bias-correc

20、ted formula requires that X contain at least three elements.,skewness(X,flag,dim) takes the skewness along dimension dim of X. skewness treats NaNs as missing values and removes them.,Examples,X = randn(5 4) X = 1.1650 1.6961 -1.4462 -0.36000.6268 0.0591 -0.7012 -0.13560.0751 1.7971 1.2460 -1.3493 0.3516 0.2641 -0.6390 -1.2704 -0.6965 0.8717 0.5774 0.9846 y = skewness(X) y = -0.2933 0.0482 0.2735 0.4641,偏度,峰度意义:,见参考文献,

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 企业管理 > 经营企划

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:道客多多官方知乎号:道客多多

经营许可证编号: 粤ICP备2021046453号世界地图

道客多多©版权所有2020-2025营业执照举报