Unit
RegModels
Use this version if you want to evaluate exponential function for multiple values at the same time. This is a lot faster than calling single value version for each x value.
| See Also |
|---|
| ExpDeriv |
| ExpFit |
Uses MathExpr, MtxVecTee, Series, RegModels; procedure Example(Series1: TLineSeries); var Y,X: Vector; begin X.Size(100); X.Ramp(-5.0, 0.05); // x= -5.0, -4.95, ... -0.05 // Y = b[0] + b[1]*X ExpEval([1,3],X,Y); DrawValues(X,Y,Series1,false); end;
#include "Math387.hpp" #include "RegModels.hpp" void __fastcall Example(TLineSeries* Series1); { Vector X,Y; X->Size(100,false); X->Ramp(-5.0, 0.05); // x= -5.0, -4.95, ... -0.05 ExpEval(OPENARRAY(TSample,(3.0, -0.5)),X,Y); DrawValues(X,Y,Series1,false); }
using Dew.Math; using Dew.Stats.Units; namespace Dew.Examples { private void Example(Steema.TeeChart.Styles.Line line1) { Vector X = new Vector(100); Vector Y = new Vector(0); X.Ramp(-5.0, 0.05); // x= -5.0, -4.95, ... -0.05 // Y = b[0] + b[1]*X RegModels.ExpEval(new double[] {1,3},X,Y); MtxVecTee.DrawValues(X,Y,line1,false); } }
Uses Math387, RegModels; var y: TSample; begin y := ExpEval([3,-0.5], 1.5); // Res = 3*Exp(-0.5*1.5) = 1.4170996582 end;
#include "Math387.hpp" #include "RegModels.hpp" void __fastcall Example(); { double y = ExpEval(OPENARRAY(TSample,(3.0, -0.5)),1.5); // y = 3*Exp(-0.5*1.5) = 1.4170996582 }
using Dew.Math; using Dew.Stats.Units; namespace Dew.Examples { private void Example() { double y = RegModels.ExpEval(new double[] {3.0, -0.5}, 1.5); // y = 3*Exp(-0.5*1.5) = 1.4170996582 } }
| Copyright 2008 Dew Research |