include/vinecopulib/vinecop/implementation/class.ipp
//! Checks if pair copulas are compatible with the R-vine structure.
Checks if pair copulas are compatible with the R-vine structure.
Checks if pair copulas are compatible with the R - vine structure .
inline void
Vinecop::check_pair_copulas_rvine_structure(
  const std::vector<std::vector<Bicop>>& pair_copulas) const
{
  size_t trunc_lvl = rvine_structure_.get_trunc_lvl();
  if (pair_copulas.size() > std::min(d_ - 1, trunc_lvl)) {
    std::stringstream message;
    message << "pair_copulas is too large; "
            << "expected size: < " << std::min(d_ - 1, trunc_lvl) << ", "
            << "actual size: " << pair_copulas.size() << std::endl;
    throw std::runtime_error(message.str().c_str());
  }
  for (size_t t = 0; t < pair_copulas.size(); ++t) {
    if (pair_copulas[t].size() != d_ - 1 - t) {
      std::stringstream message;
      message << "size of pair_copulas[" << t << "] "
              << "does not match dimension of matrix (" << d_ << "); "
              << "expected size: " << d_ - 1 - t << ", "
              << "actual size: " << pair_copulas[t].size() << std::endl;
      throw std::runtime_error(message.str().c_str());
    }
  }
}
inline void Vinecop :: check_pair_copulas_rvine_structure ( const std :: vector < std :: vector < Bicop > > & pair_copulas ) const { size_t trunc_lvl = rvine_structure_ . get_trunc_lvl ( ) ; if ( pair_copulas . size ( ) > std :: min ( d_ - 1 , trunc_lvl ) ) { std :: stringstream message ; message << " " << " " << std :: min ( d_ - 1 , trunc_lvl ) << " " << " " << pair_copulas . size ( ) << std :: endl ; throw std :: runtime_error ( message . str ( ) . c_str ( ) ) ; } for ( size_t t = 0 ; t < pair_copulas . size ( ) ; ++ t ) { if ( pair_copulas [ t ] . size ( ) != d_ - 1 - t ) { std :: stringstream message ; message << " " << t << " " << " " << d_ << " " << " " << d_ - 1 - t << " " << " " << pair_copulas [ t ] . size ( ) << std :: endl ; throw std :: runtime_error ( message . str ( ) . c_str ( ) ) ; } } }
Checks if pair copulas are compatible with the R-vine structure.
Checks if pair copulas are compatible with the R - vine structure .