title: Rule extraction of financial time series in R
body: <p>I struggle with a rule extraction algorithm using R. Generally, I had a financial time series, which I splited into different segments according to the trend and duration. As I result I got a data frame similar to this below:</p>
  
  <pre><code> &gt; head(DF)
    Segment   trend  duration description  
  1       1       C         S         C_S 
  2       2      VP         L        VP_L  
  3       3      VN         S        VN_S 
  4       4       N         S         N_S  
  5       5       P         M         P_M  
  6       6      VP         M        VP_M  
  </code></pre>
  
  <p>where VN,N,C,P,VP (very negative, negative, constant, positive, very positive) describe the trend that occured during selected segment, S,M,L (short, medium, long) describe the duration of each segment and the last column is just a combination of the previous.
  All I want to obtain are rules, where LHS contains historic information about segments and RHS is the future segment.
  So for example one rule could look like this:</p>
  
  <pre><code> ID   Rule                                  Support Confidence 
   R5   seg(t-2): VP_B &amp; seg(t-1): N_S             10      71.4%
          =&gt; seg(t): P_M
  </code></pre>
  
  <p>I want to emphasize that the segments used to create the rule should be sequential. Any ideas about proposed algorithm or r package would be appreciated.
  Thanks in advance!</p>