www.gusucode.com > mbc 工具箱 matlab 源码程序 > mbc/@mbcmodel/@linearmodel/Correlation.m

    function v = Correlation(obj)
%CORRELATION Calculates correlation matrix for the linear model parameters
%
%   STATS = CORRELATION( LINEARMODEL )
%
% See also mbcmodel.linearmodel.ParameterStatistics

%   Copyright 2006 The MathWorks, Inc.


error( obj.pAssertNotBeingEdited( 'Cannot get parameter statistics while the model is being edited.' ) );
error( obj.pAssertIsFitted() );

m = obj.Object;
% reorder statistics 
Store= get(m,'Store');
m= InitStore2(m,Store.D,Store.y);

v = cov(m);
[s,v]=xregcov2corr(v);