Created
November 23, 2009 17:11
-
-
Save jgomezdans/241201 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Find Cholesky decomposition | |
cvalue = numpy.linalg.cholesky( covar_matrix ) | |
# Locally store size of matrix | |
dims = covar_matrix.shape | |
# Add normal deviate to value, preserving lower triangular | |
covar_proposed = numpy.multiply( cvalue + random_update, numpy.tri(dims[0])) | |
# Square and replace | |
covar_proposed = covar_proposed*transpose(covar_proposed) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment