<div dir="ltr">
<p class="MsoNormal">Hi Ibtissem,</p>
<p class="MsoNormal">ARFit is a toolbox for fitting vector autoregressive
timeseries models. It uses QR factorisation to solve for a least-squares fit.
One can use the QR factors to compute the covariance matrix for progressively
lower model orders, thus enabling a step-wise least-square approach. It has
computational advantages over OLS and Yule-Walker fitting algorithms.</p>
<p class="MsoNormal">The ARFit provides a (chan X chan*order) matrix of
coefficients in the instance of a higher order model. For a higher-order model
one would compute the companion form matrix denoted, F.</p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal">% fit model to a bivariate timeseries data in variable ts</p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal">>>[w, A, C, sbc, fpe, th]=arfit(ts', 4, 4, 'sbc', 'zero');</p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"> % build companion form matrix
</p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal">>> rw_2 = [eye(2) zeros(2,2) zeros(2,2) zeros(2,2)];</p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal">>> rw_3 = [zeros(2,2) eye(2) zeros(2,2) zeros(2,2)];</p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal">>> rw_4 = [zeros(2,2) zeros(2,2) eye(2) zeros(2,2)];</p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal">>> F = [A; rw_2; rw_3; rw_4]; % final companion form matrix</p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"> % check stability
</p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal">>> eig_vals = abs(diag(jordan(F))) % jordan canonical form of A<br>
>> max(eig_vals) < 1 % should give a 1 if the system is stable</p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal">That’s pretty much it.
</p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal">Rgds,
</p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal">Matthew
</p></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 13, 2016 at 12:57 PM, Ibtissem KHOUAJA BENFRADJ <span dir="ltr"><<a href="mailto:ibtissem.khouaja@live.fr" target="_blank">ibtissem.khouaja@live.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div dir="ltr"><font face="Times New Roman,sans-serif" color="#000000"><font style="font-size:16pt" face="Times New Roman,sans-serif" size="4"><span lang="en"><span>Hi Matt, </span></span></font><br></font><br><font style="font-size:16pt" face="Times New Roman,sans-serif" size="4"><span lang="en"><span>I </span><span>thank you</span> so much <span>for your reply.</span><br><br><span>Really, you have</span> <span>undersatand</span> <span>very well my goal.</span> <span><br>In fact, I</span>'<span>d like to know</span> <span>if you have applied</span> <span>a specific</span> <span>algorithm</span> <span>for the generation of</span> <span>the</span> <span>AR</span> </span></font><font style="font-size:16pt" face="Times New Roman,sans-serif" size="4"><span lang="en"><span>matrix </span></span></font><font style="font-size:16pt" face="Times New Roman,sans-serif" size="4"><span lang="en"><span>(A).</span> <br><span>In my work</span><span>, I applied</span> <span>the algorithm</span> <span>'</span><span>arfit</span><span>'</span><span>,</span> <span>and it gives me</span> <span>a</span></span></font><font style="font-size:16pt" face="Times New Roman,sans-serif" size="4"><span lang="en"> <span>vector </span><span></span> <span>of</span> p <span>AR</span> <span>parameters for each</span> <span>signal.</span><br><br>I<span>n this case,</span> <span>how can</span> I <span>present my</span> <span>matrix</span> <span>to extract</span> <span>the eigenvalues?<br><br>Thank's a lot for your reply, Ibtissem<br><br></span></span></font><span class=""><div><font style="background-color:rgb(255,255,255)" face="Comic Sans MS" color="#666666" size="2">----------------------------------------------------------</font></div><div><font style="background-color:rgb(255,255,255)" face="Comic Sans MS" color="#666666" size="2">----------------------------------------------------------</font></div><font style="background-color:rgb(255,255,255);font-size:10pt" face="Comic Sans MS" color="#666666" size="2">Ibtissem KHOUAJA BENFRADJ</font><div><span style="background-color:rgb(255,255,255)"><font face="Comic Sans MS" color="#666666" size="2">PhD in computer science</font></span></div><div><span style="background-color:rgb(255,255,255)"><font face="Comic Sans MS" color="#666666" size="2">Speciality: Biomedical Signal Processing</font></span></div><div><span style="background-color:rgb(255,255,255)"><font face="Comic Sans MS" color="#666666" size="2">Laboratory: LTIM, University of Monastir, Tunisia</font></span></div><div><a href="http://www.labtim.org/accueil.php" target="_blank"><font style="background-color:rgb(255,255,255)" face="Comic Sans MS" color="#666666" size="2">http://www.labtim.org/accueil.php</font></a></div><div><span style="background-color:rgb(255,255,255)"><font face="Comic Sans MS" color="#666666" size="2">Laboratory: LIGM, Univerisity of Paris-East, France </font></span></div><div><a href="http://ligm.u-pem.fr/" target="_blank"><font style="background-color:rgb(255,255,255)" face="Comic Sans MS" color="#666666" size="2">http://ligm.u-pem.fr/</font></a></div><div><span style="background-color:rgb(255,255,255)"><font face="Comic Sans MS" color="#666666" size="2"><br></font></span></div><div><span style="font-size:12pt"><br></span></div><br><br></span><div><hr>Date: Tue, 3 May 2016 21:09:01 +0200<br>Subject: Re: [Eeglablist] Eigenvalues generation<br>From: <a href="mailto:matt.gerhold@gmail.com" target="_blank">matt.gerhold@gmail.com</a><br>To: <a href="mailto:ibtissem.khouaja@live.fr" target="_blank">ibtissem.khouaja@live.fr</a><br>CC: <a href="mailto:eeglablist@sccn.ucsd.edu" target="_blank">eeglablist@sccn.ucsd.edu</a><div><div class="h5"><br><br><div dir="ltr">Hi,<br><br>One would compute the eigenvalues for the autoregressive parameter matrix--your estimated beta coefficients. This would be to assess the stability of the system. One only needs to compute these eigenvalues for this matrix; nothing more nothing less... Then take the modulus of the eigenvalues, they should all be less than one. Following Lutkepohl (2005), a simple way to do this is: <br><br>if A = autoregressive parameters (K x K), where K is number of data-channels: <br><br>>> eig_vals = abs(diag(jordan(A))) % jordan canonical form of A<br>>> eig_vals < 1 % should give a vector of 1's if the system is stable<br><br>Regards,<br><br>Matthew<br><br></div><div><br><div>On Mon, May 2, 2016 at 6:20 PM, Ibtissem KHOUAJA BENFRADJ <span dir="ltr"><<a href="mailto:ibtissem.khouaja@live.fr" target="_blank">ibtissem.khouaja@live.fr</a>></span> wrote:<br><blockquote style="border-left:1px #ccc solid;padding-left:1ex">
<div><div dir="ltr"><font face="Times New Roman,sans-serif" color="#000000"><font style="font-size:16pt" size="4">Dear list, </font><br><br></font><font face="Times New Roman,sans-serif"><br></font><font style="font-size:16pt" face="Times New Roman,sans-serif" size="4"><span lang="en"><span>I applied</span> <span>the ARFIT</span> <span>algorithm</span> <span>in the generation of</span> <span>autoregressive</span> <span>parameters</span><br><span>corresponding to the time-varying of EEG.<br>Nest, </span><span>in order to</span> <span>generate</span> <span>the eigenvalues of </span><span>the</span> <span>AR</span> <span>matrix</span> <span>I used</span> <span>ARMODE</span> <span>algorithm.</span><br><br><span>I need</span> <span>your help to</span> <span>generate</span> differently <span>the eigenvalues</span> <span>for</span> <span>the</span> <span>AR</span> <span>parameters</span> <span>of</span> <span>each</span> <span>signal (AR vector) </span><span>and</span> <span>all of </span><span>signal</span> (AR matrix)<span></span></span></font><font style="font-size:16pt" face="Times New Roman,sans-serif" size="4">.<br><br>Thank you for your help, Ibtissem<br></font><br><div><font style="background-color:rgb(255,255,255)" face="Comic Sans MS" color="#666666" size="2">----------------------------------------------------------</font></div><div><font style="background-color:rgb(255,255,255)" face="Comic Sans MS" color="#666666" size="2">----------------------------------------------------------</font></div><font style="background-color:rgb(255,255,255);font-size:10pt" face="Comic Sans MS" color="#666666" size="2">Ibtissem KHOUAJA BENFRADJ</font><div><span style="background-color:rgb(255,255,255)"><font face="Comic Sans MS" color="#666666" size="2">PhD in computer science</font></span></div><div><span style="background-color:rgb(255,255,255)"><font face="Comic Sans MS" color="#666666" size="2">Speciality: Biomedical Signal Processing</font></span></div><div><span style="background-color:rgb(255,255,255)"><font face="Comic Sans MS" color="#666666" size="2">Laboratory: LTIM, University of Monastir, Tunisia</font></span></div><div><a href="http://www.labtim.org/accueil.php" target="_blank"><font style="background-color:rgb(255,255,255)" face="Comic Sans MS" color="#666666" size="2">http://www.labtim.org/accueil.php</font></a></div><div><span style="background-color:rgb(255,255,255)"><font face="Comic Sans MS" color="#666666" size="2">Laboratory: LIGM, Univerisity of Paris-East, France </font></span></div><div><a href="http://ligm.u-pem.fr/" target="_blank"><font style="background-color:rgb(255,255,255)" face="Comic Sans MS" color="#666666" size="2">http://ligm.u-pem.fr/</font></a></div><div><span style="background-color:rgb(255,255,255)"><font face="Comic Sans MS" color="#666666" size="2"><br></font></span></div><div><span style="font-size:12pt"><br></span></div> </div></div>
<br>_______________________________________________<br>
Eeglablist page: <a href="http://sccn.ucsd.edu/eeglab/eeglabmail.html" rel="noreferrer" target="_blank">http://sccn.ucsd.edu/eeglab/eeglabmail.html</a><br>
To unsubscribe, send an empty email to <a href="mailto:eeglablist-unsubscribe@sccn.ucsd.edu" target="_blank">eeglablist-unsubscribe@sccn.ucsd.edu</a><br>
For digest mode, send an email with the subject "set digest mime" to <a href="mailto:eeglablist-request@sccn.ucsd.edu" target="_blank">eeglablist-request@sccn.ucsd.edu</a><br></blockquote></div><br></div></div></div></div> </div></div>
</blockquote></div><br></div>