سؤال

I can sample from a normal distribution using Boost in c++.

I have now a simple question:

How can i sample from a multivariate normal distribution (n>2) using Boost functions (normal distribution, multi-arrays...) ?

هل كانت مفيدة؟

المحلول

I think you won't be able to do this without a little bit of linear algebra. Effectively, if you have a covariance matrix C, you can generate an upper triangular matrix L using Cholesky Decomposition such that C = L*L^T. This matrix L can be used now to generate a sample from the distribution with covariance C, by applying L to a vector of uncorrelated noise.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top