You are here: Symbol Reference > Dew Namespace > Dew.Math Namespace > Dew.Math.Units Namespace > Classes > Polynoms Class > Polynoms Methods > PolyFit Method > Polynoms.PolyFit Method (TVec, TVec, int, TVec, TMtx, out int, out double, TVec)
Dew Math for .NET
ContentsIndexHome
Example
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); } }
Copyright (c) 1999-2024 by Dew Research. All rights reserved.