/// <summary> /// 直接以Time作为X,若数据数量太少,返回null /// </summary> /// <param name="order"></param> /// <returns></returns> public virtual TimedLsPolyFit GetTimedLsPolyFit(int order) { if (order >= this.Count) { return(null); } var fit = new TimedLsPolyFit(this.Data, order); fit.Init(); return(fit); }
/// <summary> /// 多项式拟合值,将尽量查找接近指定时刻的拟合,若数据数量太少,返回null /// </summary> /// <param name="time">时间,历元</param> /// <param name="order">拟合阶次</param> /// <param name="dataCount">参与计算的数量</param> /// <returns></returns> //public virtual RmsedNumeral GetPolyFitValue(Time time, int order, int dataCount) //{ // base.GetPolyFitValue() // if (order >= this.Count) // { // return null; // } // TimedLsPolyFit fit = GetPolyFit(time, order, dataCount); // return fit.GetRmsedY(time); //} public TimedLsPolyFit GetPolyFit(Time time, int order, int dataCount) { if (order >= this.Count) { return(null); } var window = GetNearstWindowData(time, dataCount); var fit = new TimedLsPolyFit(window.Data, order); fit.Init(); return(fit); }