linfit

nbi_stat.linfit(f, x, y, delta=None)

Fit a linear model f to data

Parameters:
  • x (array-like, float) – Independent variable of length N

  • y (array-like, float) – Dependent variable of length N

  • delta (array-like, float (optional)) – Uncertainties on y

  • f (array-like, callable) – Array of length Nf, of callables that evaluate each term in the linear model

Returns:

  • p (array-like) – Estiamte of the Nf parameters

  • pcov (array-like) – Covarience matrix of p’s

See also

lsq_fit, fit, mle_fit, plot_fit