up previous next
Num.NumericalDerivative

Compute numerical derivatives of arbitrarily spaced data using local polynomial regression.
Syntax
          
NumericalDerivative(Points: MAT, MaxDiffOrd:INT, Nl:INT, Nr:INT, Deg:INT)


          

Description
This command computes numerical derivatives of given data series.

Matrix Points is considered to consist of two columns, ie., is considered to be of type Mat([[X_1,Y_1],...,[X_k, Y_k]]).

The polynomial degree Deg must be less than the window size Nl+Nr+1. The derivatives are computed up to order MaxDiffOrd. The resulting matrix has Nl+Nr rows less than Points and has MaxDiffOrd+1 columns.

Example
Points := Mat([[ I^2/800, Fn.CosN(I^2/800, 10) ] | I In 0..40 ]);

MaxDiffOrd := 3;
Nl := 4;
Nr := 4;
Deg := 3;
Mode := 0; -- Mode is currently not used!
StepWidth := 0.5;

Result := Num.NumericalDerivative(Points, MaxDiffOrd, Nl, Nr, Deg);
Dec(Result, 2); 

-- (Result) --
Mat([
  [0.99, 0.02, 0.99, 0.03]
  [0.99, 0.03, 0.99, 0.05]
[...]



See Also