Error using eig Input matrix contains NaN or Inf.

I get the error shown below trying to run a DCC GARCH Model. How can I correct this? I tried to use abs(X) on each variable but it still does not work.
Thanks for all advice in advance.
Error using eig
Input matrix contains NaN or Inf.

回答 (1 件)

Jan
Jan 2021 年 7 月 20 日

0 投票

The error message is clear: The input of eig() cannot contain NaN or Inf.
Without seeing your code, the readers cannot guess, where the NaN or Inf are coming from and how you could avoid this problem. Why do you assume that abs(X) helps and what does "on each variable" mean?

3 件のコメント

Tilman Zottl
Tilman Zottl 2021 年 7 月 20 日
R = mean(stdData,3);
r = abs(sqrt(diag(R)));
R = R ./ (r*r');
N = abs(mean(stdDataAsym,3));
%scale = max(eig(R^(-0.5)*N*R^(-0.5)));
scale = max(eig(R^(-0.5)*N*R^(-0.5)));
This is the specific code with scale being unable to execute. I meant R, r, and N by all variables.
Tilman Zottl
Tilman Zottl 2021 年 7 月 20 日
編集済み: Tilman Zottl 2021 年 7 月 20 日
Also I am ussing the dcc.m function of the MFE Toolbox
Jan
Jan 2021 年 7 月 20 日
Does r contain zeros? Then R must contain NaNs and eig() cannot work anymore.

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

カテゴリ

ヘルプ センター および File ExchangeLinear Algebra についてさらに検索

製品

リリース

R2021a

質問済み:

2021 年 7 月 20 日

コメント済み:

Jan
2021 年 7 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by