How to avoid inf

5 ビュー (過去 30 日間)
antonet
antonet 2014 年 5 月 29 日
回答済み: Udit Gupta 2014 年 5 月 29 日
Dear all,
I take the log of difference between two standard normal CDFs,
that is
D=log(normcdf()-normcdf())
but in most of the cases D=inf. Is there a way to avoid having inf?
Thanks in advance,

採用された回答

Udit Gupta
Udit Gupta 2014 年 5 月 29 日
Log of zero is -Inf. To avoid that add a small number before taking the log. For example -
D = log(normcdf() - normcdf() + 0.00001)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeParallel for-Loops (parfor) についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by