diff --git a/src/stochvol_ksc1998.cpp b/src/stochvol_ksc1998.cpp index 8de0fc5..232d00b 100644 --- a/src/stochvol_ksc1998.cpp +++ b/src/stochvol_ksc1998.cpp @@ -59,9 +59,9 @@ // [[Rcpp::export]] arma::mat stochvol_ksc1998(arma::mat y, arma::mat h, arma::vec sigma, arma::vec h_init, arma::vec constant) { - // if (y.has_nan()) { - // Rcpp::stop("Argument 'y' contains NAs."); - // } + if (y.has_nan()) { + Rcpp::stop("Argument 'y' contains NAs."); + } // Components of the mixture model arma::rowvec p_i(7), mu(7), sigma2(7); diff --git a/src/stochvol_ocsn2007.cpp b/src/stochvol_ocsn2007.cpp index 5a8c015..b7f801e 100644 --- a/src/stochvol_ocsn2007.cpp +++ b/src/stochvol_ocsn2007.cpp @@ -52,16 +52,16 @@ // [[Rcpp::export]] arma::mat stochvol_ocsn2007(arma::vec y, arma::vec h, double sigma, double h_init, double constant) { - // if (y.has_nan()) { - // Rcpp::stop("Argument 'y' contains NAs."); - // } + if (y.has_nan()) { + Rcpp::stop("Argument 'y' contains NAs."); + } // Prepare series y = log(arma::pow(y, 2) + constant); arma::uword tt = y.n_elem; - // if (y.n_elem != h.n_elem) { - // Rcpp::stop("Arguments 'y' and 'h' do not have the same length."); - // } + if (y.n_elem != h.n_elem) { + Rcpp::stop("Arguments 'y' and 'h' do not have the same length."); + } // Components of the mixture model arma::rowvec p_i(10), mu(10), sigma2(10);