Skip to content

Commit

Permalink
Added simple rank correlation option. Only kendalls' approach enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
mnarayan committed Mar 1, 2017
1 parent 48c9360 commit 26c3dab
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions @GGM/GGM.m
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@

[Theta results] = constrainMLE(SigmaHat,InitialTheta,varargin);
[W] = adaptiveWeights(Theta,varargin);
Rho = rankCovEstimate(X,varargin);

end

Expand Down
22 changes: 22 additions & 0 deletions @GGM/rankCovEstimate.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
function [Rho] = rankCovEstimate(X,varargin)
%RANKCOVESTIMATE estimates modified spearman rank correlation as a nonparametric replacement for the sample covariance from standard MLE.
%
% REFERENCES:
% "Regularized Rank Estimation of High Dimensional Nonparanormal Graphical Models", Xue an Zhou (2013)
%


% % Use spearman's
% Xranks = tiedrank(X,1);
% InitRho = corr(Xranks);
% Rho = 2*sin(pi/6.*InitRho);

% Use Kendall's
if(exist('kendalltau') & numel(X)<1e7)
Rho = kendalltau(X);
else
Rho = corr(X,'type','kendall');
end


end

0 comments on commit 26c3dab

Please sign in to comment.