I start with 4 time series designated A, B, C, D.
I create the following:
What is the Matlab code to generate a 4x1 matrix of random variables while maintaining correlations between time series?
(reason: this is the first simulation stage in Monte Carlo).
( m) ( C). , , C = R - m*m' ( , ).
m
C
C = R - m*m'
, C, IID ( ):
w = randn(4,1)
( Q) :
v = Q*w + m
sqlt Matlab sqrt (C) SVD EIG.
[u,d] = eig(C) Q = u*sqrt(d)*u'
v Q*Q' (= C), m
v
Q*Q'
. wikipedia .
Statistics, mvnrnd .
mvnrnd
C, cov , nimrodm.
cov
mvnrnd(m, C)
m - .