Note that there are some explanatory texts on larger screens.

plurals
  1. POMatlab Error: The covariance matrix of each group in TRAINING must be positive definite
    primarykey
    data
    text
    <p>I am currently looking at the effects of sampling rate and quantization on tumour signals during classification. I get the error 'The pooled covariance matrix of TRAINING must be positive definite.' ONLY when I try to classify the quantised signal (8 bits). If quantizatoin is set to >8 bits, then the codes runs perfectly! </p> <p>I am a little bit confused and would appreciate any assistance anyone may have. </p> <p>My code is as follows: </p> <pre><code> clear all; close all; clc; load('AllSignalsModified.mat') % =================================% % PCA - Feature Extraction % =================================% [cl, pcaAll]= princomp(allSignals); bestFeatures = pcaAll(:,1:100); %==============================% % Decimate allSignals %==============================% nsamp = 100; fs1 = 50e9; N = 2; fs2 = fs1/N; x = allSignals; % iterate thru each tumour signal for i = 1:960, oneRow= allSignals(i,:); downSampleRow(i,:) = oneRow(1:N:end); end; oneSampleRow = downSampleRow(1,:); %==========================================% % Quantisation %==========================================% nbits = 8; for i = 1:960, x = downSampleRow(i,:); x2 = x / max(abs(x)); x3= x2 .* 2^(nbits-1)-1; quantisedSig(i,:) = round(squeeze(x3)); end; % =================================% % LDA Classification % =================================% typeOfTumour(typeOfTumour&lt;=2) = 0; typeOfTumour(typeOfTumour&gt;=3) = 1; testSetResult = classify(quantisedSig,quantisedSig,typeOfTumour,'linear'); testSetResult1 = classify(quantisedSig,quantisedSig,typeOfTumour,'quadratic'); count = 0; for i = 1:960, if(testSetResult(i) == typeOfTumour(i)) count = count + 1; end; end; count1 = 0; for i = 1:960, if(testSetResult1(i) == typeOfTumour(i)) count1 = count1 + 1; end; end; percentageCorrect = (count/960)*100; percentageCorrect1 = (count1/960)*100; display(percentageCorrect); display(percentageCorrect1); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload