Skip to content

Commit

Permalink
Use the transpose of the cholseky decomposition (lower vs. upper tria…
Browse files Browse the repository at this point in the history
…ngle)
  • Loading branch information
coatless committed May 5, 2017
1 parent 1635a19 commit 27338a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion inst/include/dist/rmatrixnorm.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ inline arma::mat rmatnormal_chol(const arma::mat& mu,
X.imbue(norm_rand); // Use R's PNG seed instead of Armadillo

// N x P + N x N * N x P * P x P
return mu + arma::chol(Sigma_row) * X * arma::chol(Sigma_col);
return mu + arma::chol(Sigma_row, "lower") * X * arma::chol(Sigma_col);
}

// helper function
Expand Down

0 comments on commit 27338a3

Please sign in to comment.