How to use the statsmodels.tools.decorators.cache_readonly function in statsmodels

To help you get started, we’ve selected a few statsmodels examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github statsmodels / statsmodels / statsmodels / stats / contingency_tables.py View on Github external
    @cache_readonly
    def oddsratio_pooled(self):
        """
        The pooled odds ratio.

        The value is an estimate of a common odds ratio across all of the
        stratified tables.
        """
        odds_ratio = np.sum(self._ad / self._n) / np.sum(self._bc / self._n)
        return odds_ratio
github statsmodels / statsmodels / statsmodels / regression / recursive_ls.py View on Github external
    @cache_readonly
    def llf_recursive_obs(self):
        """
        (float) Loglikelihood at observation, computed from recursive residuals
        """
        from scipy.stats import norm
        return np.log(norm.pdf(self.resid_recursive, loc=0,
                               scale=self.scale**0.5))
github Geosyntec / wqio / wqio / features.py View on Github external
    @cache_readonly
    def mannwhitney_u(self):
        """Mann-Whitney U-statistic.

        Performs a basic rank-sum test.

        Notes
        -----
        Operates on untransformed, non-paired data.

        See also
        --------
        scipy.stats.mannwhitneyu

        """
        if self._mannwhitney_stats is not None:
            return self._mannwhitney_stats[0]
github statsmodels / statsmodels / statsmodels / regression / linear_model.py View on Github external
    @cache_readonly
    def uncentered_tss(self):
        """
        Uncentered sum of squares.

        The sum of the squared values of the (whitened) endogenous response
        variable.
        """
        wendog = self.model.wendog
        return np.dot(wendog, wendog)
github statsmodels / statsmodels / statsmodels / stats / tabledist.py View on Github external
    @cache_readonly
    def polyn(self):
        polyn = [interp1d(self.size, self.crit_table[:, i])
                 for i in range(self.n_alpha)]
        return polyn
github statsmodels / statsmodels / statsmodels / duration / hazard_regression.py View on Github external
    @cache_readonly
    def standard_errors(self):
        """
        Returns the standard errors of the parameter estimates.
        """
        return np.sqrt(np.diag(self.cov_params()))
github statsmodels / statsmodels / statsmodels / tsa / arima_model.py View on Github external
    @cache_readonly
    def resid(self):
        return self.model.geterrors(self.params)
github statsmodels / statsmodels / statsmodels / tsa / vector_ar / vecm.py View on Github external
    @cache_readonly
    def _chol_sigma_u(self):
        return np.linalg.cholesky(self.sigma_u)
github statsmodels / statsmodels / statsmodels / stats / outliers_influence.py View on Github external
    @cache_readonly
    def resid_studentized_internal(self):
        """Studentized residuals using variance from OLS

        this uses sigma from original estimate
        does not require leave one out loop
        """
        return self.get_resid_studentized_external(sigma=None)
        # return self.results.resid / self.sigma_est
github statsmodels / statsmodels / statsmodels / stats / outliers_influence.py View on Github external
    @cache_readonly
    def dffits(self):
        """dffits measure for influence of an observation

        based on resid_studentized_external,
        uses results from leave-one-observation-out loop

        It is recommended that observations with dffits large than a
        threshold of 2 sqrt{k / n} where k is the number of parameters, should
        be investigated.

        Returns
        -------
        dffits: float
        dffits_threshold : float

        References