ArStateModel::ArStateModel(int number_of_lags) : ArModel(number_of_lags), state_transition_matrix_(new AutoRegressionTransitionMatrix(Phi_prm())), state_variance_matrix_( new UpperLeftCornerMatrixParamView(number_of_lags, Sigsq_prm())), state_error_expander_( new FirstElementSingleColumnMatrix(number_of_lags)), state_error_variance_matrix_( new SingleSparseDiagonalElementMatrixParamView(1, Sigsq_prm(), 0)), observation_matrix_(number_of_lags), initial_state_mean_(number_of_lags, 0.0), initial_state_variance_(number_of_lags, 1.0), stationary_initial_distribution_(false) { observation_matrix_[0] = 1.0; DataPolicy::only_keep_sufstats(); }
//====================================================================== ArStateModel::ArStateModel(const ArStateModel &rhs) : Model(rhs), StateModel(rhs), ArModel(rhs), state_transition_matrix_(new AutoRegressionTransitionMatrix(Phi_prm())), state_variance_matrix_(new UpperLeftCornerMatrixParamView( Phi_prm()->nvars_possible(), Sigsq_prm())), state_error_expander_( new FirstElementSingleColumnMatrix(rhs.number_of_lags())), state_error_variance_matrix_( new SingleSparseDiagonalElementMatrixParamView(1, Sigsq_prm(), 0)), observation_matrix_(rhs.observation_matrix_), initial_state_mean_(rhs.initial_state_mean_), initial_state_variance_(rhs.initial_state_variance_), stationary_initial_distribution_(rhs.stationary_initial_distribution_) { DataPolicy::only_keep_sufstats(); }
//====================================================================== ArStateModel::ArStateModel(const ArStateModel &rhs) : Model(rhs), StateModel(rhs), ArModel(rhs), state_transition_matrix_(new AutoRegressionTransitionMatrix(Phi_prm())), state_variance_matrix_(new UpperLeftCornerMatrix( Phi_prm()->size(), 1.0)), state_variance_is_current_(false), observation_matrix_(rhs.observation_matrix_), initial_state_mean_(rhs.initial_state_mean_), initial_state_variance_(rhs.initial_state_variance_), stationary_initial_distribution_(rhs.stationary_initial_distribution_) { DataPolicy::only_keep_sufstats(); Sigsq_prm()->add_observer( boost::bind(&ArStateModel::observe_residual_variance, this)); }
ArStateModel::ArStateModel(int number_of_lags) : ArModel(number_of_lags), state_transition_matrix_( new AutoRegressionTransitionMatrix(Phi_prm())), state_variance_matrix_( new UpperLeftCornerMatrix(number_of_lags, 1.0)), state_variance_is_current_(false), observation_matrix_(number_of_lags), initial_state_mean_(number_of_lags, 0.0), initial_state_variance_(number_of_lags, 1.0), stationary_initial_distribution_(false) { observation_matrix_[0] = 1.0; DataPolicy::only_keep_sufstats(); Sigsq_prm()->add_observer( boost::bind(&ArStateModel::observe_residual_variance, this)); }
void ArModel::set_sigsq(double sigsq){ Sigsq_prm()->set(sigsq); }
void ArModel::set_sigma(double sigma){ Sigsq_prm()->set(sigma * sigma); }
double ArModel::sigsq()const{ return Sigsq_prm()->value(); }
double ArModel::sigma()const{ return sqrt(Sigsq_prm()->value()); }
double ZGM::sigsq()const{return Sigsq_prm()->value();}
void ZGM::set_sigsq(double s2){ Sigsq_prm()->set(s2);}
void IndependentMvnModel::set_sigsq_element(double sigsq, int position){ Sigsq_prm()->set_element(sigsq, position); }
void IndependentMvnModel::set_sigsq(const Vector &sigsq){ Sigsq_prm()->set(sigsq); }