segreg.model.two_bkpt_rss_func

two_bkpt_rss_func(indep, dep)[source]

Returns a function which takes a pair of bkpts and returns the RSS of a two-bkpt segmented fit.

The returned function takes a pair of arguments which are interpreted as bkpt locations. Given a pair of bkpts, it computes the RSS of a two-bkpt segmented fit to the given data for the specified bkpts. In particular, there is no estimation of the bkpts involved.

This method is intended to be used primarily for plotting or diagnosis of two-bkpt segmented regression problems.

Notes

For two-bkpt segmented regression problems, estimation of the bkpts is equivalent to minimization of the returned function.

Parameters
  • indep (array-like of shape (num_data,)) – The independent data. Also called predictor, explanatory variable, regressor, or exogenous variable.

  • dep (array-like of shape (num_data,)) – The dependent data. Also called response, regressand, or endogenous variable.

Returns

func

Return type

a function object