This function takes a list called P that consists of: Y, a matrix with columns corresponding to different outcomes in a particular partition; and psiHat, a matrix of predictions from CV.SuperLearner on the same partition of the data as the matrix Y, with columns again corresponding to different outcomes. The function computes the set of weights that maximize the value of R-squared in this partition using solnp() from the Rsolnp package.

alphaHat(Y, psiHat.Pnv0)

Arguments

Y

A matrix with columns corresponding to different outcomes

psiHat.Pnv0

A matrix of predictions from CV.SuperLearner on the validation data

Value

weights A numeric vector of weights of the same length as the number of outcomes considered. The weights sum to 1.