How to force numerator and denominator coefficients to be >0 in tfest?
4 ビュー (過去 30 日間)
古いコメントを表示
Hi! I have two timeseries, and I am using tfest to estimate the transfer function between them. I need the coefficients of both the numerator and denominator to be >= 0. Is there anyway I can force this constraint?
0 件のコメント
回答 (1 件)
Michael Hawks
2018 年 10 月 17 日
Estimating transfer functions from noisy data can be tricky, but forcing values to be >= 0 is pretty easy so I'll stick to that part of your question.
You could use (for example);
ratio = max( [numerator,0] ) ./ max( [denominator, 0] );
This will replace any negative or NaN values with 0.
Ratios of very small noisy numbers can be unstable, so you can also regularize this a bit with
ratio = ( max( [numerator,0] ) + eps ) ./ ( max( [denominator, 0] ) + eps );
eps is a built-in variable that is essentially the least-significant bit in floating point notation, so this adds a tiny amount onto both numerator and denominator. This only matters for very very small values, but avoids the ratio blowing up for denominator near zero, and approaches 1 in the limit of both numerator and denominator going to zero.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Transfer Function Models についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!