'Computes fitted values and marginal effects'

def fit(self, exog_predict=None, exog_nonparametric_predict=None):

    if (exog_predict is None):
        exog_predict = self.exog
    else:
        exog_predict = _adjust_shape(exog_predict, self.k_linear)
    if (exog_nonparametric_predict is None):
        exog_nonparametric_predict = self.exog_nonparametric
    else:
        exog_nonparametric_predict = _adjust_shape(exog_nonparametric_predict, self.K)
    N_data_predict = np.shape(exog_nonparametric_predict)[0]
    mean = np.empty((N_data_predict,))
    mfx = np.empty((N_data_predict, self.K))
    Y = (self.endog - np.dot(exog_predict, self.b)[:, None])
    for i in range(N_data_predict):
        mean_mfx = self.func(self.bw, Y, self.exog_nonparametric, data_predict=exog_nonparametric_predict[i, :])
        mean[i] = mean_mfx[0]
        mfx_c = np.squeeze(mean_mfx[1])
        mfx[i, :] = mfx_c
    return (mean, mfx)
