function estimateBase_sr
extends Modelica.Icons.Function;
import Modelica;
import Modelica_LinearSystems2;
input Modelica_LinearSystems2.DiscreteStateSpace.Internal.hBase yOut;
input Real y[:] "Measured output vector";
input Real xm[:] "Predicted state mean";
input Real ym[size(y, 1)] "Predicted output mean";
input Real u[:] "Input";
input Real CfP[size(xm, 1), size(xm, 1)] "Cholesky factor of covariance matrix";
input Real Syy[size(y, 1), size(Syy, 1)] "Transformed covariance matrix";
input Real Rxy[size(xm, 1), size(y, 1)] "Transformed cross covariance matrix";
input Modelica.Units.SI.Time Ts "Sample time";
output Real K[size(xm, 1), size(y, 1)] "Filter gain";
output Real CfPu[size(xm, 1), size(xm, 1)] "Updated Cholesky factor state covariance matrix";
output Real xmu[size(xm, 1)] "Updated state mean";
output Real ymu[size(y, 1)] "Updated output mean";
end estimateBase_sr;