楼主: xiaolanemma
3810 3

求助copulafit怎么样? [推广有奖]

  • 0关注
  • 0粉丝

大专生

83%

还不是VIP/贵宾

-

威望
0
论坛币
825 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
991 点
帖子
60
精华
0
在线时间
51 小时
注册时间
2009-3-22
最后登录
2021-1-12

楼主
xiaolanemma 发表于 2010-9-29 13:11:37 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
我想用copulafit集成两个分布,但是两个分布都是用paretotails拟合的分段分布,运行的结果提示出错:copulafit不能用分段分别,想问问高手,那分段分布怎样用copula集成呀?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:copulafit Copula opula fit 怎么样 求助 copulafit

用专业的心做专业的事!

沙发
xiaolanemma 发表于 2010-9-29 15:48:38
问题补充:如下是出错的完整信息。
??? Error using ==> piecewisedistribution.piecewisedistribution>throwNoCatError at 146
Concatenation of PIECEWISEDISTRIBUTION objects is not allowed.  Use a cell array to contain multiple objects.

Error in ==> piecewisedistribution.piecewisedistribution>piecewisedistribution.horzcat at 133
        function a = horzcat(varargin),    throwNoCatError(); end

Error in ==> shangzhfenbunihe at 6582
rho=copulafit('Gaussian',[P1,P2])
这样看的话,出错的分段分布出错,而非copulafit.我说的是否对,请高手指教。
用专业的心做专业的事!

藤椅
epoh 发表于 2010-9-29 16:42:29
问题出在paretotails
建议你逐步执行code,
才容易除错.
[url=http://www.mathworks.com/products/econometrics/demos.html?file=/products/demos/shipping/econ/Demo_RiskEVT.html#14[/url]

可供你参考的地方,帮你汇总一下:
load Data_GlobalIdx1   
returns = price2ret(Data);    % Logarithmic returns
T       = size(returns,1);
nIndices = size(Data,2);  
spec(1:nIndices) = garchset('Distribution' , 'T'  , 'Display', 'off', ...
                            'VarianceModel', 'GJR', 'P', 1, 'Q', 1, 'R', 1);
residuals = NaN(T, nIndices);  % preallocate storage
sigmas    = NaN(T, nIndices);

for i = 1:nIndices
    [spec(i)       , errors, LLF, ...
     residuals(:,i), sigmas(:,i)] = garchfit(spec(i), returns(:,i));
end
residuals = residuals ./ sigmas;
   
nPoints      = 200;      % # of sampled points of kernel-smoothed CDF
tailFraction = 0.1;      % Decimal fraction of residuals allocated to each tail

OBJ = cell(nIndices,1);
for i = 1:nIndices
    OBJ{i} = paretotails(residuals(:,i), tailFraction, 1 - tailFraction, 'kernel');
end

U = zeros(size(residuals));
for i = 1:nIndices
    U(:,i) = OBJ{i}.cdf(residuals(:,i)); % transform margin to uniform
end

[R, DoF] = copulafit('t', U, 'Method', 'ApproximateML'); % fit the copula

板凳
oval 发表于 2012-4-11 10:13:10
epoh 发表于 2010-9-29 16:42
问题出在paretotails
建议你逐步执行code,
才容易除错.
for i=1:nStocks
OBJ{i}=paretotails(residuals(:,i),tailFraction,1-tailFraction,'kernel')
end
??? Error using ==> paretotails.paretotails>init at 177
Error calling CDFFUN function '@(x)ksdensity(x,'function','cdf')'.

Error in ==> paretotails.paretotails>paretotails.paretotails at 77
        [lo,up,X,F,pLower,pUpper,qLower,qUpper] = init(x,pLower,pUpper,cdfFunc);

Caused by:
    Error using ==> mtimes
    Inner matrix dimensions must agree.

请问这是什么原因造成?

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-1 06:41