using Dew.Math;
using Dew.Math.Units;
using Dew.Math.Tee;
namespace Dew.Examples
{
private void Example()
{
Vector X =
new Vector(0);
Vector Y =
new Vector(0);
Vector YCalc =
new Vector(0);
Vector Delta =
new Vector(0);
Vector Coeff =
new Vector(0);
Matrix R =
new Matrix(0,0);
int degF;
double L2R;
X.Ramp(100);
y.Size(X);
Y.RandomGauss(2.0,3.0);
Polynoms.PolyFit(X,Y,3,Coeff,R,
out degF,
out L2R,
null);
//Fit
Polynoms.PolyEval(X,Coeff,degF,L2R,YCalc,Delta);
// Evaluate
MtxVecTee.DrawIt(
new Vector[] {Y,YCalc},
new string[] {"Original","Fit"},"Fit results",
false);
}
}