Position: Home page » Computing » Standard normal method of MATLAB decentralization method

Standard normal method of MATLAB decentralization method

Publish: 2021-04-07 12:22:03
1. Matlab中本身有Q函数,即qfunc() 其反函数是qfuncinv()

--------------------------------
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
2. The value of probability density is normpdf (x, mu, sigma), the default is normal distribution

from the probability density, the critical value is normiv (P, mu, sigma)
3. There are two kinds of normality test, depending on the sample size. If the sample size is less than 50, SW test can be used. If the sample size is greater than 50, KS test can be used. However, the standard of 50 is not fixed, because there is no fixed standard in the academic field. You can also combine the two test results to judge. In addition, I suggest that you can use the simpleton data analysis software spssau for analysis. The result will come out directly. Just drag and drop it. There is no need to write code, and there is automatic text analysis, which is very intelligent.
4. % [UNK][UNK]
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
5.

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)

6.

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

7.

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 true

8.

Using 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

9.

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 />

10. data=[...];[ A b] = normfit (data)
use the above statement.
Hot content
Inn digger Publish: 2021-05-29 20:04:36 Views: 341
Purchase of virtual currency in trust contract dispute Publish: 2021-05-29 20:04:33 Views: 942
Blockchain trust machine Publish: 2021-05-29 20:04:26 Views: 720
Brief introduction of ant mine Publish: 2021-05-29 20:04:25 Views: 848
Will digital currency open in November Publish: 2021-05-29 19:56:16 Views: 861
Global digital currency asset exchange Publish: 2021-05-29 19:54:29 Views: 603
Mining chip machine S11 Publish: 2021-05-29 19:54:26 Views: 945
Ethereum algorithm Sha3 Publish: 2021-05-29 19:52:40 Views: 643
Talking about blockchain is not reliable Publish: 2021-05-29 19:52:26 Views: 754
Mining machine node query Publish: 2021-05-29 19:36:37 Views: 750