資源簡介
以最優(yōu)的窗寬做核密度估計(jì),誤差小,比matlab自帶程序精確。
代碼片段和文件信息
%%
%[...]?=?copulafit(...‘a(chǎn)lpha‘a(chǎn)lpha,求copula參數(shù)95%置信區(qū)間內(nèi)的值
[paramhatparamci]?=?copulafit(‘Frank‘[U2(:)?V2(:)])?;
CF=copulacdf(‘Frank‘[U2(:)?V2(:)]-0.0643);
%%
%copula繪圖
%原始
load?stockreturns
x?=?stocks(:1);
y?=?stocks(:2);
scatterhist(xy)
%轉(zhuǎn)化為均一函數(shù)
u=?ksdensity(xx‘function‘‘cdf‘);
v?=?ksdensity(yy‘function‘‘cdf‘);
scatterhist(uv)
xlabel(‘u‘)
ylabel(‘v‘)
%Fit?a?t?copula:
[Rhonu]?=?copulafit(‘t‘[u?v]‘Method‘‘ApproximateML‘);
r?=?copularnd(‘t‘Rhonu1000);
u1?=?r(:1);
v1?=?r(:2);
scatterhist(u1v1)
xlabel(‘u‘)
ylabel(‘v‘)
set(get(gca‘children‘)‘marker‘‘.‘)
%Transform?the?random?sample?back?to?the?original?scale?of?the?data:
x1?=?ksdensity(xu1‘function‘‘icdf‘);
y1?=?ksdensity(yv1‘function‘‘icdf‘);
scatterhist(x1y1)
set(get(gca‘children‘)‘marker‘‘.‘)
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件????????857??2014-07-31?15:46??核函數(shù)求窗寬\KSDENSITY.m
?????目錄??????????0??2014-08-03?16:23??核函數(shù)求窗寬
-----------?---------??----------?-----??----
??????????????????857????????????????????2
- 上一篇:圖像指定位置畫紅色的矩形框
- 下一篇:紅外圖像的弱小目標(biāo)檢測與跟蹤
評論
共有 條評論