Computation of training set (X^T * W * X) and (X^T * W * Y) or (X^T * X) and (X^T * Y) in a cross-validation setting using the fast algorithms by Engstrøm and Jensen (2025).