コード例 #1
0
 private void IntegrateIntoClient(IEstimationClientModelSystem client)
 {
     client.RetrieveValue = () =>
     {
         var currentError = 0.0f;
         for (int i = 0; i < this.DataPoints.Length; i++)
         {
             var x    = this.DataPoints[i].X;
             var diff = this.DataPoints[i].Y - (this.A * (x * x * x) + this.B * (x * x) + this.C * x + this.D);
             currentError += diff * diff;
         }
         return((float)Math.Sqrt(currentError));
     };
 }
コード例 #2
0
ファイル: LineEstimation.cs プロジェクト: Cocotus/XTMF
 private void IntegrateIntoClient(IEstimationClientModelSystem client)
 {
     client.RetrieveValue = () =>
         {
             var currentError = 0.0f;
             for ( int i = 0; i < this.DataPoints.Length; i++ )
             {
                 var x = this.DataPoints[i].X;
                 var diff = this.DataPoints[i].Y - ( this.A * ( x * x * x ) + this.B * ( x * x ) + this.C * x + this.D );
                 currentError += diff * diff;
             }
             return (float)Math.Sqrt( currentError );
         };
 }