Standard normal method of MATLAB decentralization method
--------------------------------
help qfunc
qfunc
Q function
Syntax
y = qfunc(x)
Description
y = qfunc(x) is one minus the cumulative distribution function of the standardized normal random variable, evaluated at each element of the real array x. For a scalar x, the formula is
The Q function is related to the complementary error function, erfc, according to
Examples
The example below computes the Q function on a matrix, element by element.
x = [0 1 2; 3 4 5];
format short e % Switch to floating point format for displays.
y = qfunc(x)
format % Return to default format for displays.
The output is below.
y =
5.0000e-001 1.5866e-001 2.2750e-002
1.3499e-003 3.1671e-005 2.8665e-007
--------------------------------------------
help qfuncinv
qfuncinv
Inverse Q function
Syntax
y = qfuncinv(x)
Description
y = qfuncinv(x) returns the argument of the Q function at which the Q function's value is x. The input x must be a real array with elements between 0 and 1, inclusive.
For a scalar x, the Q function is one minus the cumulative distribution function of the standardized normal random variable, evaluated at x. The Q function is defined as
The Q function is related to the complementary error function, erfc, according to
Examples
The example below illustrates the inverse relationship between qfunc and qfuncinv.
x1 = [0 1 2; 3 4 5];
y1 = qfuncinv(qfunc(x1)) % Invert qfunc to recover x1.
x2 = 0:.2:1;
y2 = qfunc(qfuncinv(x2)) % Invert qfuncinv to recover x2.
The output is below.
y1 =
0 1 2
3 4 5
y2 =
0 0.2000 0.4000 0.6000 0.8000 1.0000
from the probability density, the critical value is normiv (P, mu, sigma)
y = @(x) normpdf(x,0,1)
ezplot(y)
% [UNK][UNK]2
x=[-10:0.01:10];< br />y=normpdf(x,0,1); %
figure;< br />axes1=axes(' Pos',[ 0.1 0.1 0.85 0.85]);< br />plot(x,y);< br />set(axes1,' YLim',[- 0.01 0.43],' XLim',[- 3 3]); < br />
% 标准正态[UNK][UNK]布密[UNK]函数[UNK] x=3[UNK]值
y = @(x) normpdf(x,0,1)
y(3)
..................
http://..com/question/348638889.html
http://..com/question/348923997.html#here
can use JB(Jarque-Bera)Analysis, even h=jbtest(x)
example:
>& & gt; x=normrnd(0.1.1.100);
>& & gt; jbtest(x)
ans =
0
(dynamic distribution)
>& & gt; x = rand(1.100);
>& & gt; jbtest(x)
ans =
1
(abnormal distribution)
Test of positive polarity of distribution:
x is the data you want to test
load x
histfit(x);
normplot(x);
from these two graphs, we can see whether they obey the positive Pacific distribution approximately
then estimate the parameters:
[muhat, sigmahat, MUCI, sigmaci] = norm fit (x)
muhat, sigmahat, MUCI and sigmaci represent the 0.95 confidence interval and 0.95 confidence interval of mean, variance and mean respectively
now we can use t-test to test it:
now when the variance is unknown, we can test whether the mean value is Mahat
[h,sig,ci]=ttest(x,muhat);
where h is a boolean variable and H = 0 means that zero hypothesis is not rejected, which indicates that the hypothesis of Mahat is reasonable. If h = 1, the opposite is true
CI is the confidence interval of 0.95
If sig is larger than 0.5, the null hypothesis cannot be rejected; otherwise, the opposite is true
Test of positive polarity of distribution:
x is the data you want to test
load x
histfit(x);
normplot(x);
from these two figures, we can see whether they obey the positive Pacific distribution approximately
Then the parameters were estimated:[muhat, sigmahat, MUCI, sigmaci] = normfit (x)
muhat, sigmahat, MUCI and sigmaci represent mean, variance, 0.95 confidence interval of mean and 0.95 confidence interval of variance respectively
now we can use t-test to test it:
now when the variance is unknown, we can test whether the mean value is Mahat
[h,sig,ci]=ttest(x,muhat);
where h is a boolean variable and H = 0 means that zero hypothesis is not rejected, which indicates that the hypothesis of Mahat is reasonable. If h = 1, the opposite is true
CI is the confidence interval of 0.95
If sig is larger than 0.5, the null hypothesis cannot be rejected, otherwise, the opposite is trueUsing the normrnd function
1. R = normrnd (mu, sigma): generate random numbers that obey normal distribution (mu parameter represents mean, sigma parameter represents standard deviation). The input vector or matrix Mu and sigma must have the same form, and the output r must have the same form. The scalar input will be extended to a matrix with the same dimension as other inputs
2. R = norm RND (mu, sigma, m, n): generate M × The random number matrix of n-form normal distribution
example: generate 2 * 2 normal distribution random matrix with mean value of 0 and standard deviation of 1
extended description:
there is also a function randn in MATLAB, which can proce a mean value of 0 and a variance of 0 σ^ 2 = 1, standard deviation σ = A random number or matrix with normal distribution of 1
y = randn (n) returns a matrix of n * N random terms
y = randn (m, n) or y = randn ([M, n]): returns a random term matrix of M * n
The function of normal distribution probability calculated by Matlab is normpdf, and the format is
y = normpdf (x, mu, sigma)
Mu -- mean value μ
Sigma -- standard deviation σ< br />
use the above statement.
