概率与统计分析.pptx_第1页
概率与统计分析.pptx_第2页
概率与统计分析.pptx_第3页
概率与统计分析.pptx_第4页
概率与统计分析.pptx_第5页
已阅读5页,还剩13页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

MATLAB 程序设计 1 MATLAB 程序设计 道路与桥梁工程系 副主任 Department of Civil Engineering Hefei University of Technology ; 主讲人:王佐才 “黄山青年学者教授” 第三章 概率与统计分析 2 本章内容: 统计分布的数字特征 样本分布的频数直方图描述 概率函数、分布函数、逆分布函数和随机数的发生 第三章 概率与统计分析 3 1. 统计分布的数字特征 平均值: mean Average or mean value of array 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 vectors, returning a row vector of mean values. 第三章 概率与统计分析 4 1. 统计分布的数字特征 中值: median Median value of array Syntax M = median(A) M = median(A,dim) Description M = median(A) returns the median values of the elements along different dimensions of an array. A should be of type single or double. If A is a vector, median(A) returns the median value of A. If A is a matrix, median(A) treats the columns of A as vectors, returning a row vector of median values. 第三章 概率与统计分析 5 1. 统计分布的数字特征 几何平均值: geomean Geometric mean Syntax m = geomean(x) geomean(X,dim) Description 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 along the first nonsingleton dimension of X. 第三章 概率与统计分析 6 1. 统计分布的数字特征 调和平均值: harmmean Harmonic mean Syntax m = harmmean(X) harmmean(X,dim) Description 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, harmmean(X) is a row vector containing the harmonic means of each column. For N-dimensional arrays, harmmean operates along the first nonsingleton dimension of X. harmmean(X,dim) takes the harmonic mean along dimension dim of X. 第三章 概率与统计分析 7 1. 统计分布的数字特征 标准差: std Standard deviation Syntax s = std(X) s = std(X,flag) s = std(X,flag,dim) 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 independent, identically distributed samples. If X is a matrix, std(X) returns a row vector containing 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. 第三章 概率与统计分析 8 1. 统计分布的数字特征 方差: var Variance 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 dimension 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. 第三章 概率与统计分析 9 例1. X 由下面的matlab命令流生成的矩阵: X(:,1)=ones(10,1); X(1,1)=100; X(10,1)=0.01; rand(state,1); randn(state,1) X(:,2)=rand(10,1); X(:,3)=randn(10,1); X(:,3)=2*abs(min(X(:,3)+X(:,3); 求其平均值,中值,几何平均值,调和平均 值,标准差,方差。 X_mean=mean(X) X_mid=median(X) X_gmean=geomean(X) X_hmean=harmmean(X) X_std=std(X) X_var=var(X) 第三章 概率与统计分析 10 2.样本分布的频数直方图描述 hist Histogram plot Syntax n = hist(Y) n = hist(Y,x) Description A histogram shows the distribution of data values. n = hist(Y) bins the elements in vector Y into 10 equally spaced containers and returns the number of elements in each container as a row vector. If Y is an m-by-p matrix, hist treats the columns of Y as vectors and returns a 10-by-p matrix n. Each column of n contains the results for the corresponding column of Y. No elements of Y can be complex or of type integer. n = hist(Y,x) where x is a vector, returns the distribution of Y among length(x) bins with centers specified by x. For example, if x is a 5-element vector, hist distributes the elements of Y into five bins centered on the x-axis at the elements in x, none of which can be complex. Note: use histc if it is more natural to specify bin edges instead of centers. 第三章 概率与统计分析 11 例2. x 由下面的matlab命令流生成的矩阵: randn(state,1) rand(state,31) x=randn(100,1); y=rand(100,1); subplot(2,2,1),hist(x,7) subplot(2,2,2),histfit(x,20) subplot(2,2,3),hist(y,7) subplot(2,2,4),histfit(y,20) 第三章 概率与统计分析 12 第三章 概率与统计分析 13 3. 概率函数、分布函数、逆分布函数和随机数的发生 3.1 泊松分布(Poisson distribution) poisspdf Poisson probability density function Syntax Y = poisspdf(X,lambda) Description Y = poisspdf(X,lambda) computes the Poisson pdf at each of the values in X using mean parameters in lambda. X and lambda can be vectors, matrices, or multidimensional arrays that all have the same size. A scalar input is expanded to a constant array with the same dimensions as the other input. The parameters in lambda must all be positive. 第三章 概率与统计分析 14 3.2 正态分布(Normal distribution) normpdf Normal probability density function Syntax Y = normpdf(X,mu,sigma) Description Y = normpdf(X,mu,sigma) computes the pdf at each of the values in X using the normal distribution with mean mu and standard deviation sigma. X, mu, and sigma can be vectors, matrices, or multidimensional arrays that all have the same size. A scalar input is expanded to a constant array with the same dimensions as the other inputs. The parameters in sigma must be positive. 第三章 概率与统计分析 15 3.3 2 分布(Chi-square distribution) chi2pdf Chi-square probability density function Syntax Y = chi2pdf(X,V) Description Y = chi2pdf(X,V) computes the chi-square pdf at each of the values in X using the corresponding degrees of freedom in V. X and V can be vectors, matrices, or multidimensional arrays that have the same size, which is also the size of the output Y. A scalar input is expanded to a constant array with the

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论