PARFOR Transparency violation error when using jcitest

4 ビュー (過去 30 日間)
Stéphane Surprenant
Stéphane Surprenant 2020 年 11 月 3 日
コメント済み: Stéphane Surprenant 2020 年 11 月 16 日
I am trying to run some simulations that involves using using Johnansen's test, but I always receive a transparency violation error. I prepared a minimal working example of the problem below. Is there something about the jcitest() function which makes it impossible to use in a parfor loop? Is there a way to solve that problem?
p = 4;
parfor i=1:2
y = [cumsum( randn(100,1) ), cumsum( randn(100,1) )];
[h1,~,~,~,~] = jcitest(y, 'model', 'H1*', 'lags', p-1, ...
'test', 'trace', 'display', 'off');
end
  3 件のコメント
Stéphane Surprenant
Stéphane Surprenant 2020 年 11 月 3 日
I just opened another MATLAB process with everything clear in it. I got to the bottom of my script, launched this code exactly and got a transparency violation error. I joined a screen shot here. I have no idea why I have a transparency violation error and you don't, but I assure you that this exact code does produce such an error.
Stéphane Surprenant
Stéphane Surprenant 2020 年 11 月 16 日
It turns out that if I define a function prior to the loop, say,
testing = @(y,p) jcitest(y, 'model', 'H1*', 'lags', p-1, ...
'test', 'trace', 'display', 'off');
and use it inside the loop, the problem completely goes away. I checked, double checked and triple checked... everything seem fine and it's going to massively help with my simulation study. I'll leave it here in case someone else runs into this weird problem.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeParallel Computing Toolbox についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by