Overload List
| # | Signature | Description |
|---|---|---|
| 1 | void MulLinEval(Double[] B, TMtx X, TVec YHat, Boolean Constant) | Evaluates b[0] + b[1]*x[0] + b[2]*x[1] + ... for given values in X vector, parameters in B array, and returns the results in XHat vector. |
| 2 | Double MulLinEval(Double[] B, TVec X, Boolean Constant) | Evaluates multiple linear function. |
Overload 1: void MulLinEval(Double[] B, TMtx X, TVec YHat, Boolean Constant)
Evaluates b[0] + b[1]*x[0] + b[2]*x[1] + ... for given values in X vector, parameters in B array, and returns the results in XHat vector.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | B | Double[] | |
| 2 | X | TMtx | source TMtx |
| 3 | YHat | TVec | source TVec |
| 4 | Constant | Boolean |
Result: stored in self (calling object)
Remarks:
Size and Complex properties of XHat vector are adjusted automatically.
Note
Use this version if you want to evaluate multiple linear function for multiple values at the same time. This is a lot faster than calling single value version for each x value.
Examples
using Dew.Math;
using Dew.Stats.Units;
namespace Dew.Examples
{
private void Example()
{
Matrix X = new Matrix(0,0);
Vector YHat = new Vector(0);
X.SetIt(3,3,false,new double[]{2, -3, 5,
1, 6, -4,
8, 7, 9});
// Evaluate, no constant term!
RegModels.MulLinEval(new double[] {1.0, 0.5, -2.0},X,YHat, false);
// YHat = (-9.5, 12, -6.5)
}
}
See Also: RegModels.MulLinFit
Overload 2: Double MulLinEval(Double[] B, TVec X, Boolean Constant)
Evaluates multiple linear function.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | B | Double[] | |
| 2 | X | TVec | source TVec |
| 3 | Constant | Boolean |
Returns: Double - b[0] + b[1]*x[0] + b[2]*x[1] + ... for given value X and parameters in B array.