function OID = OrderID2(K,N,M,OIDfact)
% Usage:
%  OID = OrderID2(K,N,M)
%
% Input:
%  K - number of clustered components
%  N - number of data vectors
%  M - dimension of data vectors
%  OIDfact - the term can be used to adjust the weighting
%            of the model order term. It is normally set to 1.
%            If OIDfact > 1, this tends to reduce estimated model order.
%            If OIDfact < 1, this tends to increase estimated model order.
% Ouput:
%  OID - Additive correction term for log likelihood to account for model order


% This is roughly the Rissenen criteria
% M is the number of paramters in each clustered component vector
% K*M is the total number of clustered component parameters.
% The number of scalar data values is N*M.
% Notice that this term DOES NOT account for the clustered component
% scaling parameter as required for each data vector.
% This factor is important when option 1 is used, and it is
% accounted for in OrderID1LogLike.m .

OID = -0.5*K*M*log(N*M)*OIDfact;

