def theta_(v, k, idx):
    """Estimate theta.

    Parameters
    ----------
    v: np.ndarray or list
        A vector
    k: int
        An integer
    idx: int
        An integer

    Returns
    -------
    res: float

    """
    return (v[idx + 2 * k - 1] - v[idx + k])**2