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

回答(1 个)

Parag
Parag 2025-3-5,10:42
Hi, as per my understanding you are trying to do a transformation that converts an uncorrelated Gaussian vector SN(0,I) into a correlated Gaussian vector XN(μ,Σ). 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 SN(0,I) , and Σ is decomposed as:
Σ=UAUT
where:
  • 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).
To find U and A, compute the eigenvalues and eigenvectors of Σ.
Use randn(2,1) in MATLAB or to generate a standard normal vector SN(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);

类别

Help CenterFile 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!

Translated by