MATLAB Answers

Long time to process - fit copula model

1 view (last 30 days)
Flavio
Flavio on 5 Oct 2018
Commented: Flavio on 11 Oct 2018
Hi, Matlab is taking a long time to process the code below. If I reduce the number of stocks to 6, it computes fast. If I increase to 25 which is the number that I need it does not end the calculation, I waited almost an hour (should I wait more ?) and I have to stop it. Is there another way to do it ?
%% Fit a copula model
lowerTail = 0.07; upperTail = 0.93;
for idx = 25:-1:1 currentRet = returns(:,idx); marginal{idx} = paretotails(currentRet, lowerTail, upperTail, 'kernel'); U(:,idx) = cdf(marginal{idx}, currentRet); end [rho, nu] = copulafit('t', U);

  0 Comments

Sign in to comment.

Accepted Answer

Bernhard Suhm
Bernhard Suhm on 11 Oct 2018
Sounds like you need to bring some parallelization to bear. If your computer had multiple cores, you could leverage them if you also had the Parallel Computing toolbox.

  1 Comment

Flavio
Flavio on 11 Oct 2018
Thanks Bernhard I will try to buy it then

Sign in to comment.

More Answers (0)

Sign in to answer this question.