function estimateBase
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 P[size(xm, 1), size(xm, 1)] "Covariance matrix";
input Real Ryy[size(y, 1), size(Ryy, 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 Pu[size(xm, 1), size(xm, 1)] "Updated State covariance matrix";
output Real xmu[size(xm, 1)] "Updated state mean";
output Real ymu[size(y, 1)] "Updated output mean";
end estimateBase;