statsmodels.base.model.ResultMixin.bootstrap#

ResultMixin.bootstrap(nrep=100, method='nm', disp=0, store=1, rng=None)[source]#

simple bootstrap to get mean and variance of estimator

see notes

Parameters:
nrepint

number of bootstrap replications

methodstr

optimization method to use

dispbool

If true, then optimization prints results

storebool

If true, then parameter estimates for all bootstrap iterations are attached in self.bootstrap_results

rngnp.random.RandomState or np.random.Generator, optional

Random number generator to use in the bootstrap. If None, uses the singleton RandomState provided by NumPy

Returns:
meanndarray

mean of parameter estimates over bootstrap replications

stdndarray

standard deviation of parameter estimates over bootstrap replications

Notes

This was mainly written to compare estimators of the standard errors of the parameter estimates. It uses independent random sampling from the original endog and exog, and therefore is only correct if observations are independently distributed.

This will be moved to apply only to models with independently distributed observations.