#ifndef __FILE_SVMOD_H_SEEN__
#define __FILE_SVMOD_H_SEEN__ 

#include "libscl.h"

struct sample {
  scl::realmat x0;
  scl::realmat y0;
  scl::realmat X;
  scl::realmat Y;
  sample(INTEGER n) : x0(4,1), y0(2,1), X(4,n), Y(2,n) {}
};

class svmod {
private:
  REAL a0,a1,b0,b11,b22;
  REAL r11,r21,r22,r31,r32,r33;
  scl::realmat T;
public:
  svmod() : a0(0), a1(0.1), b0(0), b11(0.01), b22(0.9), 
    r11(0.25), r21(0.0), r22(0.25), r31(0.01), r32(0), r33(0.5), T(2,2)
    { scl::realmat theta = get_parms(); set_parms(theta); } //intialze T
  void set_parms(const scl::realmat& theta);
  scl::realmat get_parms() const;
  void draw_x0_y0(scl::realmat& x,scl::realmat& y,INT_32BIT& seed) const;
  scl::realmat draw_xt(const scl::realmat& xlag, INT_32BIT& seed) const;
  REAL prob_yt(const scl::realmat& yt, const scl::realmat& xt) const;
  sample draw_sample(INTEGER n, INT_32BIT& seed) const;
};

#endif

