I wrote this MATLAB/Octave function to use along with the Bayes Classifier.Is this the correct approach? Is the following logic correct?if(feat>1)   mu = mean(train(clidx,feat));  sigma = std(train(clidx,feat));else   mu = 1;  sigma = 1;endpdfindep.mfunction pdfmx = pdfindep(train, test)classnb = rows(unique(train(:,1)));pdfmx = ones(rows(test), classnb);for cl=1:classnb  clidx = train(:,1) == cl;  indiv = zeros(rows(test), columns(test));  for feat=1:columns(test)    %%strcat(num2str(clidx),',', num2str(feat))    if(feat>1)       mu = mean(train(clidx,feat));      sigma = std(train(clidx,feat));    else       mu = 1;      sigma = 1;    end    indiv(:,feat) = normpdf(test(:,feat), mu, sigma);  end  pdfmx(:,cl) = prod(indiv,2);endTest data you can usetrain.txttest.txt 
Finding the density of multidimensional random vectors (independence)
matlab;octave