Having a keyword argument that passes a vector of weights that get to the error function. Note that we don’t want to put the input parser into the error function itself. The parser is very slow, and the error function gets called a lot. So always pass a vector of weights to the error function, but have it default to all ones in the caller. It is probably faster to weight the contrasts than to check whether a passed weight vector is empty and only weight conditionally.
Having a keyword argument that passes a vector of weights that get to the error function. Note that we don’t want to put the input parser into the error function itself. The parser is very slow, and the error function gets called a lot. So always pass a vector of weights to the error function, but have it default to all ones in the caller. It is probably faster to weight the contrasts than to check whether a passed weight vector is empty and only weight conditionally.