- U is an orthogonal matrix (eigenvectors of Σ ).
- A is a diagonal matrix (eigenvalues of Σ).
- A ½ is the square root of A (element-wise square root of eigenvalues).
showing the transformation converts problem
9 次查看(过去 30 天)
显示 更早的评论
from Gaussian vector, (mean (1; 1) , cov ( 2 1 ; 1 1),
take 2 dimenttional smaple vector "randn(2, 1)" and uncorrelated Gaussian S ~ N (0, I)
and I habe to transformation X=UA^1/2S + µ cpnverts the uncorrelated Gaussian vector into the correlated Gaussian vector, where ∑ = UAU^T
please help me to find where to start from, I even dont know where to start
0 个评论
回答(1 个)
Parag
2025-3-5,10:42
Hi, as per my understanding you are trying to do a transformation that converts an uncorrelated Gaussian vector S∼N(0,I) into a correlated Gaussian vector X∼N(μ,Σ). Let's break this down step by step.
We have a mean vector:
μ=[1 1]
and a covariance matrix:
Σ=[2 1
1 1]
The target is to generate samples from X using the transformation:
X= UA 1/2S +μ
where S∼N(0,I) , and Σ is decomposed as:
Σ=UAUT
where:
To find U and A, compute the eigenvalues and eigenvectors of Σ.
Use randn(2,1) in MATLAB or to generate a standard normal vector S∼N(0,I).
Compute:
X=UA½S + μ
This converts the uncorrelated vector S into a correlated Gaussian sample.
Here’s a MATLAB implementation:
% Given mean and covariance
mu = [1; 1];
Sigma = [2 1; 1 1];
% Eigen decomposition of Sigma
[U, A] = eig(Sigma);
% Compute A^(1/2)
A_sqrt = sqrt(A);
% Generate an uncorrelated Gaussian vector
S = randn(2,1);
% Apply the transformation
X = U * A_sqrt * S + mu;
% Display the transformed sample
disp('Sample from correlated Gaussian distribution:');
disp(X);
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!