<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/245710</link>
    <title>MATLAB Central Newsreader - Feature Extraction for EMG data using PCA</title>
    <description>Feed for thread: Feature Extraction for EMG data using PCA</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Mon, 02 Mar 2009 16:20:20 -0500</pubDate>
      <title>Feature Extraction for EMG data using PCA</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/245710#631930</link>
      <author>anoop </author>
      <description>I have a EMG data matrix of size 90(subjects) x 4800(variables). I want to apply PCA to reduce the no. of variables, e.g ( i want matrix of size 90 x 1200 after PCA).&lt;br&gt;
I need a matlab program to do so. suggestions are welcome!!</description>
    </item>
    <item>
      <pubDate>Tue, 03 Mar 2009 14:35:06 -0500</pubDate>
      <title>Re: Feature Extraction for EMG data using PCA</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/245710#632138</link>
      <author>russell.fung@gmail.com</author>
      <description>On Mar 2, 10:20=A0am, &quot;anoop &quot; &amp;lt;nomail...@rediffmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; I have a EMG data matrix of size 90(subjects) x 4800(variables). I want t=&lt;br&gt;
o apply PCA to reduce the no. of variables, e.g ( i want matrix of size 90 =&lt;br&gt;
x 1200 after PCA).&lt;br&gt;
&amp;gt; I need a matlab program to do so. suggestions are welcome!!&lt;br&gt;
&lt;br&gt;
You can write a program to do PCA using subroutines included in basic&lt;br&gt;
Matlab without any extra toolboxes.&lt;br&gt;
&lt;br&gt;
You need to find the eigenvectors and eigenvalues of the covariance&lt;br&gt;
matrix of your data, from which you find the most significant&lt;br&gt;
principal components, then you expand your data along the principal&lt;br&gt;
directions.</description>
    </item>
    <item>
      <pubDate>Wed, 04 Mar 2009 10:53:01 -0500</pubDate>
      <title>Re: Feature Extraction for EMG data using PCA</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/245710#632387</link>
      <author>anoop </author>
      <description>&quot;russell.fung@gmail.com&quot; &amp;lt;russell.fung@gmail.com&amp;gt; wrote in message &amp;lt;6a1f9244-51d8-4e3b-9fb8-2aefcab53109@y33g2000prg.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; On Mar 2, 10:20=A0am, &quot;anoop &quot; &amp;lt;nomail...@rediffmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt; I have a EMG data matrix of size 90(subjects) x 4800(variables). I want t=&lt;br&gt;
&amp;gt; o apply PCA to reduce the no. of variables, e.g ( i want matrix of size 90 =&lt;br&gt;
&amp;gt; x 1200 after PCA).&lt;br&gt;
&amp;gt; &amp;gt; I need a matlab program to do so. suggestions are welcome!!&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; You can write a program to do PCA using subroutines included in basic&lt;br&gt;
&amp;gt; Matlab without any extra toolboxes.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; You need to find the eigenvectors and eigenvalues of the covariance&lt;br&gt;
&amp;gt; matrix of your data, from which you find the most significant&lt;br&gt;
&amp;gt; principal components, then you expand your data along the principal&lt;br&gt;
&amp;gt; directions.&lt;br&gt;
&lt;br&gt;
well i wrote the program as given below:&lt;br&gt;
max_PCs=1200;&lt;br&gt;
covariance_matrix=cov(data);&lt;br&gt;
[eigvect,eigval]=eig(covariance_matrix);&lt;br&gt;
eigval=diag(eigval);&lt;br&gt;
[junk,rindices]=sort(-1*eigval);&lt;br&gt;
eigen_values=eigval(rindices);&lt;br&gt;
arranged_eigen_vectors=eigvect(:,rindices);&lt;br&gt;
eigen_values_extacted=eigen_values(1:max_PCs);&lt;br&gt;
principle_components=arranged_eigen_vectors(:,1:max_PCs);&lt;br&gt;
projected_data=xpca*principle_components;&lt;br&gt;
&lt;br&gt;
but it takes very long time to execute. could you please give me faster matlab code?? what should i use for training the neural network (projected data or principal components) ??</description>
    </item>
    <item>
      <pubDate>Wed, 04 Mar 2009 14:46:10 -0500</pubDate>
      <title>Re: Feature Extraction for EMG data using PCA</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/245710#632454</link>
      <author>russell.fung@gmail.com</author>
      <description>On Mar 4, 4:53=A0am, &quot;anoop &quot; &amp;lt;nomail...@rediffmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; &quot;russell.f...@gmail.com&quot; &amp;lt;russell.f...@gmail.com&amp;gt; wrote in message &amp;lt;6a1f9=&lt;br&gt;
244-51d8-4e3b-9fb8-2aefcab53...@y33g2000prg.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; On Mar 2, 10:20=3DA0am, &quot;anoop &quot; &amp;lt;nomail...@rediffmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; I have a EMG data matrix of size 90(subjects) x 4800(variables). I wa=&lt;br&gt;
nt t=3D&lt;br&gt;
&amp;gt; &amp;gt; o apply PCA to reduce the no. of variables, e.g ( i want matrix of size=&lt;br&gt;
&amp;nbsp;90 =3D&lt;br&gt;
&amp;gt; &amp;gt; x 1200 after PCA).&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; I need a matlab program to do so. suggestions are welcome!!&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; You can write a program to do PCA using subroutines included in basic&lt;br&gt;
&amp;gt; &amp;gt; Matlab without any extra toolboxes.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; You need to find the eigenvectors and eigenvalues of the covariance&lt;br&gt;
&amp;gt; &amp;gt; matrix of your data, from which you find the most significant&lt;br&gt;
&amp;gt; &amp;gt; principal components, then you expand your data along the principal&lt;br&gt;
&amp;gt; &amp;gt; directions.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; well i wrote the program as given below:&lt;br&gt;
&amp;gt; max_PCs=3D1200;&lt;br&gt;
&amp;gt; covariance_matrix=3Dcov(data);&lt;br&gt;
&amp;gt; [eigvect,eigval]=3Deig(covariance_matrix);&lt;br&gt;
&amp;gt; eigval=3Ddiag(eigval);&lt;br&gt;
&amp;gt; [junk,rindices]=3Dsort(-1*eigval);&lt;br&gt;
&amp;gt; eigen_values=3Deigval(rindices);&lt;br&gt;
&amp;gt; arranged_eigen_vectors=3Deigvect(:,rindices);&lt;br&gt;
&amp;gt; eigen_values_extacted=3Deigen_values(1:max_PCs);&lt;br&gt;
&amp;gt; principle_components=3Darranged_eigen_vectors(:,1:max_PCs);&lt;br&gt;
&amp;gt; projected_data=3Dxpca*principle_components;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; but it takes very long time to execute. could you please give me faster m=&lt;br&gt;
atlab code?? what should i use for training the neural network (projected d=&lt;br&gt;
ata or principal components) ??&lt;br&gt;
&lt;br&gt;
The PCA function in MATLAB's statistical toolbox may be faster,&lt;br&gt;
although I have never tried it.&lt;br&gt;
&lt;br&gt;
You can also ask yourself if you really need an exact PCA solution? If&lt;br&gt;
an approximate solution is good enough, take a look at&lt;br&gt;
&lt;a href=&quot;http://www.cse.msu.edu/~weng/research/ccipca.m&quot;&gt;http://www.cse.msu.edu/~weng/research/ccipca.m&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
Russell</description>
    </item>
    <item>
      <pubDate>Tue, 10 Mar 2009 16:29:00 -0400</pubDate>
      <title>Re: Feature Extraction for EMG data using PCA</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/245710#633790</link>
      <author>Greg Heath</author>
      <description>On Mar 4, 6:53 am, &quot;anoop &quot; &amp;lt;nomail...@rediffmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; &quot;russell.f...@gmail.com&quot; &amp;lt;russell.f...@gmail.com&amp;gt; wrote in message &amp;lt;6a1f9244-51d8-4e3b-9fb8-2aefcab53...@y33g2000prg.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; On Mar 2, 10:20=A0am, &quot;anoop &quot; &amp;lt;nomail...@rediffmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; I have a EMG data matrix of size 90(subjects) x 4800(variables). I want t=&lt;br&gt;
&amp;gt; &amp;gt; o apply PCA to reduce the no. of variables, e.g ( i want matrix of size 90 =&lt;br&gt;
&amp;gt; &amp;gt; x 1200 after PCA).&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; I need a matlab program to do so. suggestions are welcome!!&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; You can write a program to do PCA using subroutines included in basic&lt;br&gt;
&amp;gt; &amp;gt; Matlab without any extra toolboxes.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; You need to find the eigenvectors and eigenvalues of the covariance&lt;br&gt;
&amp;gt; &amp;gt; matrix of your data, from which you find the most significant&lt;br&gt;
&amp;gt; &amp;gt; principal components, then you expand your data along the principal&lt;br&gt;
&amp;gt; &amp;gt; directions.&lt;br&gt;
&lt;br&gt;
I agree. I do not recommend picking a number like 1200 out&lt;br&gt;
of mid air when you can use the diagonal eigenvalue matrix&lt;br&gt;
to estimate a more practical value. Typical rules of thumb are&lt;br&gt;
&lt;br&gt;
1. Exclude eigenvectors associated with eigenvalues that&lt;br&gt;
are less than x% (e.g., 1%) of the maximum eigenvalue.&lt;br&gt;
2. Keep the minimum number of eigenvectors that will&lt;br&gt;
preserve x% of the trace of the covariance matrix.&lt;br&gt;
&lt;br&gt;
Recall that&lt;br&gt;
&lt;br&gt;
trace(cov(A)) = sum(diag(cov(A)))= sum(eig(A))&lt;br&gt;
&lt;br&gt;
&amp;gt; well i wrote the program as given below:&lt;br&gt;
&amp;gt; max_PCs=1200;&lt;br&gt;
&amp;gt; covariance_matrix=cov(data);&lt;br&gt;
&amp;gt; [eigvect,eigval]=eig(covariance_matrix);&lt;br&gt;
&lt;br&gt;
Wasted effort calculating 3600 useless eigenvectors&lt;br&gt;
&lt;br&gt;
&amp;gt; eigval=diag(eigval);&lt;br&gt;
&amp;gt; [junk,rindices]=sort(-1*eigval);&lt;br&gt;
&lt;br&gt;
help fliplr&lt;br&gt;
help flipud&lt;br&gt;
&lt;br&gt;
&amp;gt; eigen_values=eigval(rindices);&lt;br&gt;
&lt;br&gt;
= junk?&lt;br&gt;
&lt;br&gt;
&amp;gt; arranged_eigen_vectors=eigvect(:,rindices);&lt;br&gt;
&amp;gt; eigen_values_extacted=eigen_values(1:max_PCs);&lt;br&gt;
&amp;gt; principle_components=arranged_eigen_vectors(:,1:max_PCs);&lt;br&gt;
&amp;gt; projected_data=xpca*principle_components;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; but it takes very long time to execute. could you please give me faster matlab code?? what should i use for training theneuralnetwork (projected data or principal components) ??&lt;br&gt;
&lt;br&gt;
C = cov(data); L0 = eig(C);         % No eigenvectors&lt;br&gt;
L = diag(L0); cumsumL = cumsum(L);&lt;br&gt;
&lt;br&gt;
% Find r to preserve 95% (or your choice) of trace(C), i.e.,&lt;br&gt;
% cumsumL(r-1) &amp;lt; 0.95*cumsumL(end) &amp;lt;= cumsumL(r-1)&lt;br&gt;
% Then use EIGS (NOT EIG) to caclculate exactly r&lt;br&gt;
% eigenvectors&lt;br&gt;
&lt;br&gt;
Hope this helps.&lt;br&gt;
&lt;br&gt;
Greg</description>
    </item>
    <item>
      <pubDate>Tue, 10 Mar 2009 16:36:57 -0400</pubDate>
      <title>Re: Feature Extraction for EMG data using PCA</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/245710#633795</link>
      <author>Greg Heath</author>
      <description>On Mar 4, 6:53=A0am, &quot;anoop &quot; &amp;lt;nomail...@rediffmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; &quot;russell.f...@gmail.com&quot; &amp;lt;russell.f...@gmail.com&amp;gt; wrote in message &amp;lt;6a1f9=&lt;br&gt;
244-51d8-4e3b-9fb8-2aefcab53...@y33g2000prg.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; On Mar 2, 10:20=3DA0am, &quot;anoop &quot; &amp;lt;nomail...@rediffmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; I have a EMG data matrix of size 90(subjects) x 4800(variables). I wa=&lt;br&gt;
nt t=3D&lt;br&gt;
&amp;gt; &amp;gt; o apply PCA to reduce the no. of variables, e.g ( i want matrix of size=&lt;br&gt;
&amp;nbsp;90 =3D&lt;br&gt;
&amp;gt; &amp;gt; x 1200 after PCA).&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; I need a matlab program to do so. suggestions are welcome!!&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; You can write a program to do PCA using subroutines included in basic&lt;br&gt;
&amp;gt; &amp;gt; Matlab without any extra toolboxes.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; You need to find the eigenvectors and eigenvalues of the covariance&lt;br&gt;
&amp;gt; &amp;gt; matrix of your data, from which you find the most significant&lt;br&gt;
&amp;gt; &amp;gt; principal components, then you expand your data along the principal&lt;br&gt;
&amp;gt; &amp;gt; directions.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; well i wrote the program as given below:&lt;br&gt;
&amp;gt; max_PCs=3D1200;&lt;br&gt;
&amp;gt; covariance_matrix=3Dcov(data);&lt;br&gt;
&amp;gt; [eigvect,eigval]=3Deig(covariance_matrix);&lt;br&gt;
&amp;gt; eigval=3Ddiag(eigval);&lt;br&gt;
&amp;gt; [junk,rindices]=3Dsort(-1*eigval);&lt;br&gt;
&amp;gt; eigen_values=3Deigval(rindices);&lt;br&gt;
&amp;gt; arranged_eigen_vectors=3Deigvect(:,rindices);&lt;br&gt;
&amp;gt; eigen_values_extacted=3Deigen_values(1:max_PCs);&lt;br&gt;
&amp;gt; principle_components=3Darranged_eigen_vectors(:,1:max_PCs);&lt;br&gt;
&amp;gt; projected_data=3Dxpca*principle_components;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; but it takes very long time to execute. could you please give me faster m=&lt;br&gt;
atlab code?? what should i use for training theneuralnetwork (projected dat=&lt;br&gt;
a or principal components) ??&lt;br&gt;
&lt;br&gt;
If you use principal components, what would you use for targets?&lt;br&gt;
&lt;br&gt;
If you are designing a classifier use PLS,&lt;br&gt;
not PCA.&lt;br&gt;
&lt;br&gt;
Hope this helps.&lt;br&gt;
&lt;br&gt;
Greg</description>
    </item>
  </channel>
</rss>

