title: Error when using msmFit in R
body: <p>I'm trying to simulate this paper (<em>Point Forecast Markov Switching Model for U.S. Dollar/ Euro Exchange Rate</em>, by Hamidreza Mostafei) in R. The table that I'm trying to get is on page 483. <a href="http://www.ukm.my/jsm/pdf_files/SM-PDF-41-4-2012/14%20Hamidreza.pdf" rel="nofollow">Here</a> is a link to a pdf.  </p>
  
  <p>I wrote the following codes and then got an error at the last line:</p>
  
  <pre><code>mydata &lt;- read.csv("C:\\Users\\User\\Downloads\\EURUSD_2.csv", header=T)   
  mod    &lt;- lm(EURUSD~EURUSD.1, mydata)  
  mod.mswm = msmFit(mod, k=2, p=1, sw=c(T,T,T,T), control=list(parallel=F))
  
  Error in if ((max(abs(object["Fit"]["logLikel"] - oldll))/(0.1 + max(abs(object["Fit"]["logLikel"]))) &lt;  : 
    missing value where TRUE/FALSE needed
  </code></pre>
  
  <p>Basically the data that's being used is <code>EURUSD</code>, which is the level change in monthly frequency. <code>EURUSD.1</code> is the one lag variable. Both <code>EURUSD</code> and <code>EURUSD.1</code> are in my csv file. (I'm not sure how to attach the csv file here. If someone could point that out that would be great). </p>
  
  <p>I changed the <code>EURUSD.1</code> values to something random and <code>msmFit</code> function seemed to work. But whenever I tried using the original value, i.e. the lag value, the error came out. </p>