polyreg

Calculates the polynomial regression value y that satisfies the equation y = P1 * x^n + P2 * x^(n-1) + ... + Pn * x + Pn+1 for an inputted argument x.

Arguments

  1. Input matrix m
  2. Input value or vector x
  3. Integer n, degree of polynomial

Output

Resulting value or vector

Examples

polyreg