<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _initParams(self, init_method=None):
 """ this function initializes the paramenter and Ifilter """

        if self.bgRE:
            if init_method=='random':
                params0 = {'covar': sp.randn(self._gpNull.covar.getNumberParams())}
            else:
                if self.P==1:
                    params0 = {'covar':sp.sqrt(0.5) * sp.ones(2)}
                else:
                    cov = 0.5*sp.cov(self.Y.T) + 1e-4*sp.eye(self.P)
                    chol = la.cholesky(cov, lower=True)
                    params = chol[sp.tril_indices(self.P)]
                    params0 = {'covar': sp.concatenate([params, params])}
        else:
            if self.P==1:
                params_cn = sp.array([1.])
            else:
                cov = sp.cov(self.Y.T) + 1e-4*sp.eye(self.P)
                chol = la.cholesky(cov, lower=True)
                params_cn = chol[sp.tril_indices(self.P)]
            params0 = {'covar': params_cn}
        return params0