Covariance from standard deviation and correlation (covcorr)

This MATLAB function converts standard deviation and the correlation matrix to a covariance matrix
10 descargas
Actualizado 29 ene 2024

Ver licencia

This MATLAB function converts standard deviation and correlation to covariance
INPUTS:
psigma = vector of standard deviations for each of any number of variables or parameters
prho = correlation matrix of the correlations between each each variable or parameter
OUTPUTS:
pcov = covariance matrix between variables or parameters
EXAMPLE:
load hospital
X = [hospital.Weight hospital.BloodPressure];
% Find the correlation matrix for the variables X:
prho = corrcoef(X)
% prho =
% 1.0000 0.1558 0.2227
% 0.1558 1.0000 0.5118
% 0.2227 0.5118 1.0000
% Find the standard deviations of each variable X
psigma = std(X)
% psigma =
% 26.5714 6.7128 6.9325
% Find the covariance matrix between variables X:
pcov = covcorr(psigma,prho)
% pcov =
% 706.0404 27.7879 41.0202
% 27.7879 45.0622 23.8194
% 41.0202 23.8194 48.0590

Citar como

Gregory Pelletier (2024). Covariance from standard deviation and correlation (covcorr) (https://www.mathworks.com/matlabcentral/fileexchange/158046-covariance-from-standard-deviation-and-correlation-covcorr), MATLAB Central File Exchange. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R2023b
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux
Etiquetas Añadir etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Versión Publicado Notas de la versión
1.0.3

updated title

1.0.2

updated readme

1.0.1

updated readme

1.0.0