matlab概率與統計_第1頁
matlab概率與統計_第2頁
matlab概率與統計_第3頁
matlab概率與統計_第4頁
matlab概率與統計_第5頁
已閱讀5頁,還剩18頁未讀 繼續免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1、1MATLAB 程序設計程序設計Department of Civil EngineeringHefei University of Technology 第九章 概率與統計分析2本章內容: 統計分布的數字特征 樣本分布的頻數直方圖描述 概率函數、分布函數、逆分布函數和隨機數的發生第三章 概率與統計分析31. 統計分布的數字特征第三章 概率與統計分析41. 統計分布的數字特征平均值:平均值:mean Average or mean value of arraySyntaxM = mean(A)M = mean(A,dim)DescriptionM = mean(A) returns the m

2、ean 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. 第三章 概率與統計分析5第三章 概率與統計分析61. 統計分布的數字特征中值:中值:medianMedian value of arraySyntaxM =

3、 median(A)M = median(A,dim)DescriptionM = 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, returni

4、ng a row vector of median values. 第三章 概率與統計分析71. 統計分布的數字特征幾何平均值:幾何平均值:geomeanGeometric meanSyntaxm = geomean(x)geomean(X,dim)Descriptionm = 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 vect

5、or containing the geometric means of each column. For N-dimensional arrays, geomean operates along the first nonsingleton dimension of X.第三章 概率與統計分析81. 統計分布的數字特征調和平均值:調和平均值:harmmeanHarmonic meanSyntaxm = harmmean(X)harmmean(X,dim)Descriptionm = harmmean(X) calculates the harmonic mean of a sample. F

6、or 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 d

7、im of X.第三章 概率與統計分析96.第三章 概率與統計分析101. 統計分布的數字特征標準差:標準差:stdStandard deviationSyntaxs = 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 fr

8、om 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

9、 first nonsingleton dimension of X.第三章 概率與統計分析111. 統計分布的數字特征方差:方差:varVarianceSyntaxV = var(X)V = var(X,1)V = var(X,w)V = var(X,w,dim)DescriptionV = 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,

10、 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.第三章 概率與統計分析12例1. X 由下面的由下面的matlab命令流生成的矩陣:命令流生成的矩陣:X(:,1)=ones(10,1);X(1,1)=

11、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)第三章 概率與統計分析132.樣本分布的頻數直方圖描述histHistogram

12、plotSyntaxn = hist(Y)n = hist(Y,x)DescriptionA 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 v

13、ectors 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

14、 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. 第三章 概率與統計分析14例2. x 由下面的由下面的matlab命令流生成的矩陣:命令流生成的矩陣:randn(state,1)rand(state,3

15、1)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)第三章 概率與統計分析15第三章 概率與統計分析163. 概率函數、分布函數、逆分布函數和隨機數的發生3.1 泊松分布(Poisson distribution)poisspdfPoisson probability density functionSyntaxY = poisspdf(X,lambda)DescriptionY

16、 = 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 pa

17、rameters in lambda must all be positive.第三章 概率與統計分析173.2 正態分布(Normal distribution)normpdfNormal probability density functionSyntaxY = normpdf(X,mu,sigma)DescriptionY = normpdf(X,mu,sigma) computes the pdf at each of the values in X using the normal distribution with mean mu and standard deviation si

18、gma. 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.第三章 概率與統計分析183.3 2 分布(Chi-square distribution)chi2pdfChi-squar

19、e probability density functionSyntaxY = chi2pdf(X,V)DescriptionY = 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 same dimen

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論