% PCDA Performs Principal Component Discriminant Analysis |
% |
% USAGE: |
% strike=pcda(test,train,class,ndis,plflag,prflag); |
% |
% INPUTS: |
% test : an (m x p) array of test data to classify |
%m is the number of test data to classify |
%p is the number of variates |
% train: an (n x p) array of data used for training |
%n is the number of data of the training set |
% class: an (n x 1) vector with the class of the train dataset |
%as an integer ranging from 1 to the number of classes |
% ndis: optional integer number specifying the procedure used for |
%the density estimation by Kernel regression for each class: |
%n(k) <= ndis ==> estimate of the density function for each sample |
%computed from the whole training dataset by Kernel regression |
%n(k) > ndis ==> estimate of the density function computed once from |
%the training set on an equispaced grid with approximately |
%ndis points by Kernel regression; then for each |
%test data, density is computed by linear interpolation. |
%This option speeds up computations |
%ndis < 0 or missing always implies the first option |
%(n(k) is the number of training data belonging to class k) |
% plflag: optional flag for producing plots: |
%plflag = 0 ==> no plot |
%plflag = 1 ==> summary plots |
%plflag = 2 ==> detailed plots |
%plflag < 0 or missing ==> no plot |
% prflag: optional flag for prior: |
%prflag = 0 ==> uniform prior |
%prflag = 1 ==> class frequencies estimated on the training set |
% |
% |
% OUTPUTS |
% strike: an (m x 1) vector containing the class of the test dataset as |
%assigned by the method |
% |
% Example: |
% train = mvnrnd( 1 1, eye(2), 100); … |
%mvnrnd(−1 −1, 2*eye(2), 100)]; |
% class = repmat(1,100,1); repmat(2,100,1)]; |
% test = unifrnd(−5, 5, 100, 2); |
% strike = pcda(test,train,class); |
% |
% Copyright 2002–2008 Umberto Amato, Istituto per le Applicazioni del Calcolo |
% Mauro Picone CNR, Napoli (Italy) and Anestis Antoniadis, Laboratoire de |
% Modelisation et Calcul IMAG, Universite J. Fourier, Grenoble (France) |