Test of normal distribution of MATLAB (final) _matlab
Developer on Alibaba Coud: Build your first app with APIs, SDKs, and tutorials on the Alibaba Cloud. Read more ＞
% normal distribution test%%c.s. Ruan
X Figure hist (x),% frequency histogram (see whether the naked eye is symmetrical, middle more, both sides less) figure; Histfit (x);% normal curve fitting normfit (x);% normality test (whether discrete points are distributed on a straight line, indicating that samples are from normal distribution, otherwise non-normal distribution)% parameter estimation [muhat,sigmahat,muci,sigmaci]= Normfit (x);%muhat mean, sigmahat variance, Muci mean 0.95 confidence interval, Sigmaci variance 0.95 confidence Interval% hypothesis test (now if the variance is unknown, verify that the mean value is Mahat) [h,sig,ci]= TTest (X,muhat); %h=0, accept the assumption that the mean =mahat% of which H is a Boolean variable, h=0 that the 0 hypothesis is not rejected, the assumption that the mean value is mahat is reasonable. If H=1 is the opposite;%ci represents a confidence interval of 0.95. If the%sig is larger than 0.5, it cannot reject the 0 hypothesis, otherwise.
------------------------percent more formal test method of%kstest Kolmogorov-smirnov Normal test, the sample and standard normal distribution (mean 0, Variance is 1) to compare, do not conform to normal distribution return 1, otherwise return 0 ; The function can also be used for testing other distribution types; [H,p,jbstat,cv]=kstest (x); %h0: Obey the normal n (0,1)
%lillietest lilliefors test. Unlike Kstest, the test target is not a standard normal state, but it has the same distribution as the mean and variance of the sample. [H,p,istat,cv]=lillietest (x); %h0: Obey N (MU,SIGMA2);
%jbtest Jarque-bera test. Similar to lilliefors test, but not for small samples. [H,p,jbstat,cv]=jbtest (x); %h0: Obey the normal n (MU,SIGMA2)
This article is an English version of an article which is originally in the Chinese language on aliyun.com and is provided for information purposes only. This website makes no representation or warranty of any kind, either expressed or implied, as to the accuracy, completeness ownership or
reliability of the article or any translations thereof. If you have any concerns or complaints relating to the article, please send an email, providing a detailed description of the concern or
complaint, to email@example.com. A staff member will contact you within 5 working days. Once verified, infringing content will be removed immediately.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
and provide relevant evidence. A staff member will contact you within 5 working days.