<div dir="ltr">Thanks for the reply Eric. It is great to get hints and suggestions from the author directly!<div><br></div><div>I used the commands that you outlined, and they were able to reproduce the expected output verbatim, which is great. Thanks for clearing that up for me. I've gotten further towards my goal.</div>

<div><br></div><div>I've now got three questions:</div><div><br></div><div>1)  I get an unexpected result when I run ms_var() on my own data. I run these commands:</div><div><br></div><div>load('arhmm_example.dat')</div>

<div><div style="font-family:arial,sans-serif;font-size:13px">nb_states=2</div><div style="font-family:arial,sans-serif;font-size:13px">switch_var=2 // variances are switching</div><div style="font-family:arial,sans-serif;font-size:13px">

var_opt=3 // unrestricted var-cov matrix</div></div><div>r=ms_var('cte',3,'ardata',nb_states,switch_var,var_opt,'prt=initial;final','opt_convg=0')<br></div><div><br></div><div>I receive this output:</div>

<div><br></div><div><div>WARNING: in overlay, series number 2 has been ignored because of a bad frequency</div><div> !--error 10000 </div><div>series ends before the end date of the bounds</div><div>at line      39 of function ts2vec0 called by :  </div>

<div>at line     101 of function explone called by :  </div><div>at line     253 of function ms_var called by :  </div><div>r=ms_var('cte',3,'ardata',nb_states,switch_var,var_opt,'prt=initial;final','opt_convg=0')</div>

</div><div><br></div><div>The arhmm_example.dat file is available here[0], and it was made by running.the following command on the original csv[1] file arhmm_example.csv.</div><div><br></div><div>impexc2bd('arhmm_example.csv', ';', 'arhmm_example.dat')<br>

</div><div><br></div><div>I believe I either don't have the dates configured correctly, or it requires a specific number of data points to match the frequency value, which also may be wrong. Do you have some insight into this error message? I've been reading the docs on the ts structure, and I will continue to try to solve this roadblock.</div>

<div><br></div><div><br></div><div>2) My goal in doing all this is to analyze Autoregressive Hidden Markov Models. As I understand it, the VAR-HMM that ms_var provides is a multivariate case of an Autoregressive Hidden Markov Model. The terms Markov Switching Model, and Hidden Markov Model refer to the same thing. Using a single variable with ms_var() as I show above in the example, will simulate an AR-HMM(3). I would like to check if these statements agree with your understanding.</div>

<div><br></div><div><br></div><div>3) How could I contribute to the grocer code. At the very least I could improve the docs some.</div><div><br></div><div><br></div><div>[0]:  <a href="https://s3.amazonaws.com/dfsklfdsklfds/fdsjkfsdjkfds/arhmm_example.dat">https://s3.amazonaws.com/dfsklfdsklfds/fdsjkfsdjkfds/arhmm_example.dat</a></div>

<div>[1]:  <a href="https://s3.amazonaws.com/dfsklfdsklfds/fdsjkfsdjkfds/arhmm_example.csv">https://s3.amazonaws.com/dfsklfdsklfds/fdsjkfsdjkfds/arhmm_example.csv</a><br></div><div><br></div><div>Thanks,</div><div>Brian</div>

</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, May 20, 2014 at 3:55 PM, Eric Dubois <span dir="ltr"><<a href="mailto:grocer.toolbox@gmail.com" target="_blank">grocer.toolbox@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello Brian<div><br></div><div>Sorry for this late answer, but I have been quite busy these days.</div>
<div>
<br></div><div>I did not notice the problem with this version of the MS programs. Indeed I have changed the optimization device of all GROCER programs and I have not adapted the defaults for the MS programs.</div>
<div><br></div><div>If you run:</div><div>--> global GROCERDIR;</div><div>--> load(GROCERDIR+'\data\us_revu.dat')</div><div>--> bounds('1967m4','2004m2')</div><div> </div><div>--> nb_states=2</div>


<div>--> switch_var=2 // variances are switching</div><div>--> var_opt=3 // unrestricted var-cov matrix</div><div> </div><div>--> r=ms_var('cte',3,'100*(log(us_revu)-lagts(2,log(us_revu)))',nb_states,switch_var,var_opt,'prt=initial;final','opt_convg=0')</div>


<div>(see chapter 6 of the manual for explanations)</div><div><br></div><div>Then the results of the ms_var demo is restaured.</div><div><br></div><div>I will change the default in Grocer next version .</div><div><br></div>


<div>Regards.</div><div><br></div><div>Éric.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-05-19 12:56 GMT+02:00 Brian Bouterse <span dir="ltr"><<a href="mailto:bmbouter@gmail.com" target="_blank">bmbouter@gmail.com</a>></span>:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">Hi Scilab community!<div><br></div><div>I'm new to Scilab, and the AR-HMM and VAR-HMM solving capabilities of GROCER are what interest me.</div>


<div><br></div><div>I have a question relating to Chapter 23 from the GROCER manual[0].  This is the univariate MS-AR(3) solved using the function ms_reg_d() on the us_revu.dat data included with GROCER.  I have made no adjustment from the example statements in Chapter 23.</div>




<div><br></div><div>The example output is shown on pages 4 and 5 of the Chapter 23 module.  Compare that against the output I receive.</div><div><br></div><div><a href="http://fpaste.org/102978/14004958/" target="_blank">http://fpaste.org/102978/14004958/</a><br>




</div><div><br></div><div>Here are my questions:</div><div><br></div><div>1.  The numerical output is completely different.  I expected it to be the same since the data is provided by GROCER, and I've done the example exactly as shown in Chapter 23.  Is there some explanation to why the solved solution I receive is different than the example output in the chapter?</div>




<div><br></div><div>2.  I see output like %i*8.4469016 which seems like an error because %i looks like a variable that yet needs to be replaced, and then multiplied to get to its final value.  Is this some kind of bug or error?</div>




<div><br></div><div>Thanks for any help the community can provide.  We'll be using this for a seminar on HMM, AR-HMM, and VAR-HMM at North Carolina State University.  I'm also a developer, so I really appreciate all the effort that has been put into scilab and GROCER. </div>




<div><br></div><div>Thanks,</div><div>Brian</div><div><br></div><div><br></div><div>[0]:  <a href="http://dubois.ensae.net/Grocer_manual_v1.6.zip" target="_blank">http://dubois.ensae.net/Grocer_manual_v1.6.zip</a></div><span><font color="#888888"><div>


<br clear="all">

<div><br></div>-- <br><div dir="ltr">Brian Bouterse<br></div>
</div></font></span></div>
<br></div></div>_______________________________________________<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>
<br></blockquote></div><br></div>
<br>_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@lists.scilab.org">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>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Brian Bouterse<br></div>
</div>