To load data, you have many solutions. For time series I recommend to store your data in a .txt file, transform the dates in a suitable format (that is 1993q1, 1993q2, etc.), set the name of the corresponding column to "dates" and use impexc2bd (see impexc2bd). And have a look at chapter 5 of the manual (as well as chapters 1, 2 and 3  which can also be helpful before starting any econometric estimation).<br>

<br>For the second question, using one of the functions ms_var, ms_reg or ms_mean indicates that you are estimating a Markov-switching model: there rare not other steps inovolved!<br><br>Lastly, I do not understand what you mean by "conditioning the var-cov matrix"; if by this, you mean that the var-cov matrix is different according to the state of the economy, then give as 3rd argument of function ms_mean of 5th argument of function ms_reg the number of states you assumes the economy can experience (this is what is done in the example provided in ms_reg_d() with the instruction :"switch_var=2 // variances are switching").<br>
<br>Éric.<br>
<br><br>PS : turnpoints is a subroutine used by the brybos program, therefore not relevant for Markov-switching estimation <br>
<br><div class="gmail_quote">2013/1/10 ericdoblas <span dir="ltr"><<a href="mailto:ericdoblasargentina@yahoo.com.ar" target="_blank">ericdoblasargentina@yahoo.com.ar</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear Éric,<br>
<br>
The following information is  in you example, but I have a lot of doubts,<br>
for exmple:<br>
<br>
<br>
----- How to load the data?<br>
----- How indicate it is MSM?<br>
<br>
<br>
I hope you can help me!!<br>
<div><br>
Thank you very much!<br>
<br>
Eric Doblas<br>
<br>
<br>
</div>function [bcp,bct] = turnpoints(y,k)<br>
<br>
// PURPOSE: rough selection of peaks and troughs indexes<br>
//---------------------------------------------------------------------<br>
// INPUT:<br>
// . y = vector of data<br>
// . k = x(t-i)>x(t) & x(t+i)>x(t), i=1:k defines a trough at t<br>
//       x(t-i)<x(t) & x(t+i)<x(t), i=1:k defines a peak at t<br>
//---------------------------------------------------------------------<br>
// OUTPUTS :<br>
// . bcp = vector of peak indexes<br>
// . bct = vector of trough indexes<br>
//---------------------------------------------------------------------<br>
// Translated to Scilab by E. Michaux (2005)<br>
// from Julien Matheron<br>
// Banque de France, centre de recherche, sept. 2002<br>
<br>
[T,n] = size(y);<br>
if T<n then<br>
   y = y';<br>
   [T,n] = size(y);<br>
end;<br>
v = zeros(T,n);<br>
<br>
// ------------------------------------------<br>
// I. Defines the k-dependent logical<br>
// argument of the following "if-loops"<br>
// ------------------------------------------<br>
<br>
s_up = "(y(i)>y(i-1))";<br>
s_do = "(y(i)<y(i-1))";<br>
<br>
for step = 2:k;<br>
   s_up = joinstr(s_up,msprintf("&(y(i)>y(i-%d))",step),'+');<br>
   s_do = joinstr(s_do,msprintf("&(y(i)<y(i-%d))",step),'+');<br>
end;<br>
<br>
for step=1:k<br>
   s_up = joinstr(s_up,msprintf("&(y(i)>y(i+%d))",step),'+');<br>
   s_do = joinstr(s_do,msprintf("&(y(i)<y(i+%d))",step),'+');<br>
end;<br>
<br>
<br>
// ------------------------------------------<br>
// II. Defines peaks<br>
// ------------------------------------------<br>
<br>
for i = k+1:T-k ;<br>
   if evstr(s_up) then<br>
      v(i) = 1;<br>
   end;<br>
end<br>
bcp = find(v>0)'; // selects indexes such that a peak occurs<br>
<br>
// ------------------------------------------<br>
// III. Defines troughs<br>
// ------------------------------------------<br>
<br>
v = zeros(T,n); // reinitializes v<br>
<br>
for i = k+1:T-k<br>
   if evstr(s_do) then<br>
      v(i) = 1 ;<br>
   end;<br>
end;<br>
bct = find(v>0)'; // selects indexes such that a trough occurs<br>
endfunction<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://mailinglists.scilab.org/Grocer-Markov-Switching-Model-tp4025635p4025649.html" target="_blank">http://mailinglists.scilab.org/Grocer-Markov-Switching-Model-tp4025635p4025649.html</a><br>




<div><div>Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.<br>
_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@lists.scilab.org" target="_blank">users@lists.scilab.org</a><br>
<a href="http://lists.scilab.org/mailman/listinfo/users" target="_blank">http://lists.scilab.org/mailman/listinfo/users</a><br>
</div></div></blockquote></div><br>