API

segreg.model: Models

OLSRegressionEstimator()

Estimator for ordinary least-squares regression.

OneBkptSegRegEstimator([num_end_to_skip, ...])

Estimator for one-bkpt segmented regression.

TwoBkptSegRegEstimator([num_end_to_skip, ...])

Estimator for two-bkpt segmented regression.

one_bkpt_rss_func(indep, dep)

Returns a function which takes a bkpt and returns the RSS of a one-bkpt segmented fit.

two_bkpt_rss_func(indep, dep)

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

segreg.analysis: Tools for Analyzing Results

plot_models(func_arr, indep, dep[, ...])

Plots univariate functions together with scatter of the data.

plot_one_bkpt_segreg_rss(indep, dep[, lines])

plot_two_bkpt_segreg_rss(indep, dep)

segreg.bootstrap: Bootstrap

boot_conf_intervals(indep, dep, estimator[, ...])

Bootstrap confidence intervals for regression models.

bca_acceleration(estimator, indep, dep)

see: stata manual on the bootstrap

model_bca(boot_sims, orig_sample_estimate, ...)

Computes BCa (bias-corrected and accelerated) confidence intervals for regression models.

bca(boot_sims, orig_sample_estimate, ...[, ...])

Computes BCa (bias-corrected and accelerated) confidence intervals for a single parameter.

boot_basic_conf_interval(boot_sims, ...[, ...])

Name follows Davison and Hinkley.

boot_percentile_conf_interval(boot_sims, ...)

boot_param_dist(indep, dep, estimator, num_sims)

Computes bootstrap sampling distribution of model parameters.

boot_resample(indep, dep[, fitted_values, ...])

A single boot resampling for a regression model.

random_selection_with_replacement(series)

Random draw with replacement from series.

random_selection_with_replacement_two_series(...)

Random draw with replacement.

segreg.data: Datasets

hinkley()

A dataset from an academic paper by David Hinkley.

test1()

Random dataset for testing.

test2()

Random dataset for testing.

segreg.model.alt: Alternative Implementations

Pure Python Segmented Regression

fit_one_bkpt(indep, dep[, num_end_to_skip, ...])

Estimate one-bkpt segmented regression model.

fit_two_bkpt(indep, dep[, num_end_to_skip, ...])

Estimate two-bkpt segmented regression model.