polyregcoef

Calculates the polynomial regression coefficients that satisfy the equation y = P1 * x^n + P2 * x^(n-1) + ... + Pn * x + Pn+1 for every node (x,y).

Arguments

  1. Input matrix m
  2. Integer n, degree of polynomial

Output

Vector of coefficients [P1,P2, ..., Pn+1]

Examples

polyregcoef