def assemble_covariance(error, correlation):
covariance = []<EOL>for n in range(<NUM_LIT:0>, len(error)):<EOL><INDENT>covariance.append([])<EOL>for m in range(<NUM_LIT:0>, len(error)):<EOL><INDENT>covariance[n].append(correlation[n][m]*error[n]*error[m])<EOL><DEDENT><DEDENT>return _n.array(covariance)<EOL>
This takes an error vector and a correlation matrix and assembles the covariance