I have some input and output data that I believe adequately includes excitation of the important dynamics of a system. I know it is at most a 4th-order transfer function.
How can I identify the transfer function? I have Python available. (I have MATLAB but do not have access to the System ID Toolbox and need to limit my dependencies on MATLAB)
I know how to do least-squares fits, but I have no idea how to apply the idea to transfer functions, where using the absolute error in the transfer function doesn't make sense (relative error seems to be the appropriate thing to fit).
I'm vaguely familiar with ARX/ARMA/ARMAX approaches but they always seem to overemphasize the high-frequency response, because they solve for the impulse response.