How to force numerator and denominator coefficients to be >0 in tfest?
13 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Michael Hawks
el 17 de Oct. de 2018
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 comentarios
Ver también
Categorías
Más información sobre Transfer Function Models en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!