<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _init_ws(n_items, comparisons, prior_inv, tau, nu):
 """Initialize parameters in the weight space."""

    prec = np.zeros((n_items, n_items))
    xs = np.zeros(n_items)
    for i, (a, b) in enumerate(comparisons):
        prec[(a, a, b, b), (a, b, a, b)] += tau[i] * MAT_ONE_FLAT 
        xs[a] += nu[i]
        xs[b] -= nu[i]
    cov = inv_posdef(prior_inv + prec)
    mean = cov.dot(xs)
    return mean, cov, xs , prec