matlab去中心化方法標准正態法
㈠ 用兩種方法使用MATLAB畫出一維標准正態的分布密度函數圖,並計算標准正態的分布密度函數在 x=3的值..
% 方法1
y = @(x) normpdf(x,0,1)
ezplot(y)
% 方法2
x=[-10:0.01:10];
y=normpdf(x,0,1); %正態分布函數。
figure;
axes1=axes('Pos',[0.1 0.1 0.85 0.85]);
plot(x,y);
set(axes1,'YLim',[-0.01 0.43],'XLim',[-3 3]);
% 標准正態的分布密度函數在 x=3的值
y = @(x) normpdf(x,0,1)
y(3)
..................
http://..com/question/348638889.html
http://..com/question/348923997.html#here
㈡ 如何在MATLAB中進行正態分布檢驗
正態性檢驗有兩種,看樣本大小,小於50可以使用SW檢驗,大於50可以使用KS檢驗,但是50這個標准並不固定,因為學術上並沒有固定好標准。你也可以結合兩個檢驗結果進行判斷即可。另外個人建議你可以使用傻瓜化的數據分析軟體SPSSAU進行分析,裡面直接就出來這樣的結果,拖拽下就好了,不用寫代碼,而且有自動化文字分析,非常智能。
㈢ 急!!!怎麼用matlab把一組數據擬合成正態分布
data=[...];[a b]=normfit(data)
用上面語句即可。
㈣ 如何matlab取正態分布隨機數
運用normrnd函數。
1. R=normrnd(MU,SIGMA):生成服從正態分布(MU參數代表均值,SIGMA參數代表標准差)的隨機數。輸入的向量或矩陣MU和SIGMA必須形式相同,輸出R也和它們形式相同。標量輸入將被擴展成和其它輸入具有相同維數的矩陣。
2. R=normrnd(MU,SIGMA,m,n): 生成m×n形式的正態分布的隨機數矩陣。
實例:生成均值為0,標准差為1的2*2正態分布隨機矩陣。
拓展說明:
matlab中還有個函數randn,可以產生均值為0,方差σ^2 = 1,標准差σ = 1的正態分布的隨機數或矩陣。
Y = randn(n)返回一個n*n的隨機項的矩陣;
Y = randn(m,n) 或 Y = randn([m n]):返回一個m*n的隨機項矩陣。
㈤ 急~~~~標准正態分布的Q函數用 matlab 怎麼寫
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
㈥ matlab求解標准正態分布函數的值,是哪個函數
求概率密度值是 normpdf(x,mu,sigma),預設為標准正態分布
從概率密度反查臨界值是 norminv(P,mu,sigma)
㈦ 怎麼用《matlab》驗證正態分布,並給出正態分布的表達式
分布的正太性檢驗:
x為你要檢驗的數據。
load x
histfit(x);
normplot(x);
從這兩個圖中可以看出是否近似服從正太分布。
然後估計參數:
[muhat,sigmahat,muci,sigmaci]=normfit(x);
muhat , sigmahat,muci,sigmaci 分別表示均值、方差、均值的0.95置信區間、方差0.95置信區間。
現在可以用t檢驗法對其進行檢驗:
現在在方差未知的情況下,檢驗均值是否為mahat;
[h,sig,ci]=ttest(x,muhat);
其中h為布爾變數,h=0表示不拒絕零假設,說明均值為mahat的假設合理。若h=1則相反;
ci表示0.95的置信區間。
sig若比0.5大則不能拒絕零假設,否則相反。
㈧ 怎麼用matlab驗證正態分布,並給出正態分布的表達式
分布的正太性檢驗:
x為你要檢驗的數據。
load x
histfit(x);
normplot(x);
從這兩個圖中可以看出是否近似服從正太分布。
然後估計參數:
[muhat,sigmahat,muci,sigmaci]=normfit(x);
muhat , sigmahat,muci,sigmaci 分別表示均值、方差、均值的0.95置信區間、方差0.95置信區間。
現在可以用t檢驗法對其進行檢驗:
現在在方差未知的情況下,檢驗均值是否為mahat;
[h,sig,ci]=ttest(x,muhat);
其中h為布爾變數,h=0表示不拒絕零假設,說明均值為mahat的假設合理。若h=1則相反;
ci表示0.95的置信區間。
sig若比0.5大則不能拒絕零假設,否則相反。
㈨ 如何在MATLAB中進行正態分布檢驗
可以用JB( Jarque-Bera)檢驗, 即 h=jbtest(x)
例:
>> x=normrnd(0,1,1,100);
>> jbtest(x)
ans =
0
(正態分布)
>> x = rand(1,100);
>> jbtest(x)
ans =
1
(非正態分布)
㈩ 用matlab怎麼求正態分布概率
用matlab求正態分布概率的函數是normpdf,使用格式為
Y = normpdf(X,mu,sigma)
mu——均值μ
sigma——標准偏差σ