8f388d6ff37b3573a284078103906a1dc8ab27e3,linearmodels/iv/covariance.py,KernelCovariance,s,#KernelCovariance#,514

Before Change


            self._auto_bandwidth = True
            if kernel in ("newey-west", "bartlett"):
                bw = ceil(4 * (nobs / 100) ** (2 / 9))
            elif kernel in ("andrews", "quadratic-spectral", "qs"):
                bw = ceil(4 * (nobs / 100) ** (2 / 25))
            else:
                bw = ceil(4 * (nobs / 100) ** (4 / 25))
        self._bandwidth = bw = int(bw)
        w = self._kernels[kernel](bw, nobs - 1)

        pinvz = self._pinvz

After Change



        pinvz = self._pinvz
        xhat = z @ (pinvz @ x)
        xhat_e = xhat * eps

        kernel = self.config["kernel"]
        bw = self.config["bandwidth"]
        if bw is None:
            self._auto_bandwidth = True
            from linearmodels.utility import has_constant
            const, loc = has_constant(xhat)
            sel = ones((xhat.shape[1], 1))
            if const:
                sel[loc] = 0
            scores = xhat_e @ sel
            bw = kernel_optimal_bandwidth(scores, kernel)

        self._bandwidth = bw = int(bw)
        w = self._kernels[kernel](bw, nobs - 1)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: bashtage/linearmodels
Commit Name: 8f388d6ff37b3573a284078103906a1dc8ab27e3
Time: 2017-03-15
Author: kevin.k.sheppard@gmail.com
File Name: linearmodels/iv/covariance.py
Class Name: KernelCovariance
Method Name: s


Project Name: EpistasisLab/tpot
Commit Name: 2ab8c1444facbd46df8767a5badda5b9f1a50c29
Time: 2016-08-01
Author: supacoofoo@gmail.com
File Name: tpot/tpot.py
Class Name: TPOT
Method Name: predict


Project Name: ysig/GraKeL
Commit Name: b996639740adde1bf4b39b278e83c4c295ad65ca
Time: 2018-09-24
Author: y.siglidis@gmail.com
File Name: grakel/kernels/random_walk.py
Class Name: RandomWalk
Method Name: pairwise_operation