function [BIC] = BIC_count(V,U,ts,data,N,Nclusters)
% BIC score computation
%   Inputs: V : Centers matrix of OLYMPUS
%           U : Membership matrix of OLYMPUS
%          ts : Time points
%   Nclusters : Number of Clusters
%        data : dataset
%           N : rows of data
    [~, cluster_idx] = max(U);
    dist = distance_matrix(V, ts, data);
    RSS = 0;
    for i=1:N,
        RSS = RSS + dist(cluster_idx(i), i).^2;
    end
    % Calculate BIC score at the current number of clusters
    BIC = N*log(RSS/N)+Nclusters*log(N);
    fprintf('BIC value in %d clusters, is: %d.\n', Nclusters,BIC);
    fprintf('-----------------------------------------------------\n');
end

