b0de6536107cc932a7e5e046d07ae4adf910bbde,linearmodels/panel/model.py,BetweenOLS,fit,#BetweenOLS#Any#,316

Before Change


        y = self.dependent.mean("entity").values
        x = self.exog.mean("entity").values

        params = pinv(x) @ y
        df_resid = y.shape[0] - x.shape[1]
        cov = HomoskedasticCovariance(y, x, params, df_resid)

        eps = y - x @ params
        resid_ss = float(eps.T @ eps)
        if self._constant:
            mu = y - y.mean()
        else:
            mu = 0
        total_ss = float((y - mu).T @ (y - mu))
        r2 = 1 - resid_ss / total_ss

After Change


        y = self.dependent.mean("entity").values
        x = self.exog.mean("entity").values

        params = lstsq(x, y)[0]
        df_resid = y.shape[0] - x.shape[1]
        cov = HomoskedasticCovariance(y, x, params, df_resid)

        eps = y - x @ params
        resid_ss = float(eps.T @ eps)
        if self._constant:
            mu = y.mean()
        else:
            mu = 0
        total_ss = float((y - mu).T @ (y - mu))
        r2 = 1 - resid_ss / total_ss
        r2w, r2b = self._rsquared(params)
        entity_info, time_info = self._info()
        res = AttrDict(params=params, deferred_cov=cov.deferred_cov,
                       debiased=debiased, df_resid=df_resid,
                       df_model=x.shape[1], nobs=self.dependent.values2d.shape[0],
                       name=self._name, var_names=self.exog.vars,
                       residual_ss=resid_ss, total_ss=total_ss,
                       r2=r2, r2w=r2w, r2b=r2b, s2=cov.s2,
                       entity_info=entity_info, time_info=time_info)
        return PanelResults(res)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: bashtage/linearmodels
Commit Name: b0de6536107cc932a7e5e046d07ae4adf910bbde
Time: 2017-03-28
Author: kevin.k.sheppard@gmail.com
File Name: linearmodels/panel/model.py
Class Name: BetweenOLS
Method Name: fit


Project Name: bashtage/linearmodels
Commit Name: b0de6536107cc932a7e5e046d07ae4adf910bbde
Time: 2017-03-28
Author: kevin.k.sheppard@gmail.com
File Name: linearmodels/panel/model.py
Class Name: PanelOLS
Method Name: fit


Project Name: bashtage/linearmodels
Commit Name: b0de6536107cc932a7e5e046d07ae4adf910bbde
Time: 2017-03-28
Author: kevin.k.sheppard@gmail.com
File Name: linearmodels/panel/model.py
Class Name: PooledOLS
Method Name: fit