Compute the coefficient of determination for outcomes in n-dimensions.
May be useful for multidimensional predictions (such as a multinomial model) or
calculating goodness of fit from latent variable models such as probabilistic
topic models like latent Dirichlet allocation or deterministic topic models
like latent semantic analysis. Based on Jones (2019)