/// <summary> /// kalman滤波构造函数。 /// </summary> /// <param name="coeff">A n*m阶设计矩阵,也称观测矩阵,系数阵</param> /// <param name="apriori">先验值</param> /// <param name="observation">观测值 L,满足 l = L - (AX0 + D), 若X0与D为null, 则l=L </param> /// <param name="trans">Φ 状态转移矩阵和Q_m 动力模型噪声向量 W 的方差</param> /// <param name="approx">参数近似向量X0,满足 l = L - (AX0 + D) </param> /// <param name="freeVector">常数项D,满足 l = L - (AX0 + D) </param> public AdjustObsMatrix( WeightedVector apriori, WeightedVector observation, Matrix coeff, WeightedMatrix trans, Vector approx = null, Vector freeVector = null ) { this.Coefficient = coeff; this.Apriori = apriori; this.Observation = observation; this.Transfer = trans; this.ApproxVector = approx; this.FreeVector = freeVector; }
/// <summary> /// 解析为对象 /// </summary> /// <param name="splitterOfMatrixItems"></param> /// <param name="obs"></param> /// <param name="currentBlockSb"></param> /// <param name="currentType"></param> private static void ParseBufferText(string[] splitterOfMatrixItems, AdjustObsMatrix obs, StringBuilder currentBlockSb, ObsMatrixType currentType) { switch (currentType) { case ObsMatrixType.Apriori: obs.Apriori = WeightedVector.Parse(currentBlockSb.ToString()); break; case ObsMatrixType.Observation: obs.Observation = WeightedVector.Parse(currentBlockSb.ToString(), splitterOfMatrixItems); break; case ObsMatrixType.Coefficient: obs.Coefficient = Matrix.Parse(currentBlockSb.ToString(), splitterOfMatrixItems); break; case ObsMatrixType.SecondCoefficient: obs.SecondCoefficient = Matrix.Parse(currentBlockSb.ToString(), splitterOfMatrixItems); break; case ObsMatrixType.Transfer: obs.Transfer = WeightedMatrix.Parse(currentBlockSb.ToString(), splitterOfMatrixItems); break; case ObsMatrixType.ApproxVector: obs.ApproxVector = Vector.Parse(currentBlockSb.ToString()); break; case ObsMatrixType.SecondApproxVector: obs.SecondApproxVector = Vector.Parse(currentBlockSb.ToString()); break; case ObsMatrixType.FreeVector: obs.FreeVector = Vector.Parse(currentBlockSb.ToString()); break; case ObsMatrixType.SecondFreeVector: obs.SecondFreeVector = Vector.Parse(currentBlockSb.ToString()); break; default: break; } currentBlockSb.Clear(); }
/// <summary> /// 设置转移矩阵 /// </summary> /// <param name="Transfer"></param> /// <returns></returns> public ManualAdjustMatrixBuilder SetTransfer(WeightedMatrix Transfer) { this.Transfer = Transfer; return(this); }