Ejemplo n.º 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));
     };
 }
Ejemplo n.º 2
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 );
         };
 }