#ifndef __FILE_SVMOD_H_SEEN__
#define __FILE_SVMOD_H_SEEN__ 

#include "libscl.h"

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

class svmod {
private:
  REAL a0,b0,b11,b22;
  REAL r11,r21,r22,r31,r32,r33;
  scl::realmat T;
public:
  svmod() : a0(0), 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); } //intialize T
  void set_parms(const scl::realmat& theta);
  scl::realmat get_parms() const;
  scl::realmat draw_x0(INT_32BIT& seed) const;
  scl::realmat draw_xt(const scl::realmat& xlag, INT_32BIT& seed) const;
  REAL prob_yt(REAL yt, scl::realmat xt) const;
  sample draw_sample(INTEGER n, INT_32BIT& seed) const;
};

#endif

