include/vinecopulib/vinecop/implementation/tools_select.ipp
//! chooses threshold for next iteration such that at a proportion of at
//! least 2.5% of the previously thresholded pairs become non-thresholded.
chooses threshold for next iteration such that at a proportion of at
least 2.5% of the previously thresholded pairs become non-thresholded.
chooses threshold for next iteration such that at a proportion of at least 2 . 5% of the previously thresholded pairs become non - thresholded .
inline double
VinecopSelector::get_next_threshold(std::vector<double>& thresholded_crits)
{
  if (thresholded_crits.size() == 0) {
    return 1.0;
  }
  std::sort(thresholded_crits.begin(), thresholded_crits.end());
  std::reverse(thresholded_crits.begin(), thresholded_crits.end());
  double alpha = 0.05;
  size_t m = thresholded_crits.size();
  double new_index = std::ceil(static_cast<double>(m) * alpha) - 1;
  return thresholded_crits[static_cast<size_t>(new_index)];
}
inline double VinecopSelector :: get_next_threshold ( std :: vector < double > & thresholded_crits ) { if ( thresholded_crits . size ( ) == 0 ) { return 1.0 ; } std :: sort ( thresholded_crits . begin ( ) , thresholded_crits . end ( ) ) ; std :: reverse ( thresholded_crits . begin ( ) , thresholded_crits . end ( ) ) ; double alpha = 0.05 ; size_t m = thresholded_crits . size ( ) ; double new_index = std :: ceil ( static_cast < double > ( m ) * alpha ) - 1 ; return thresholded_crits [ static_cast < size_t > ( new_index ) ] ; }
chooses threshold for next iteration such that at a proportion of at
least 2.5% of the previously thresholded pairs become non-thresholded.
chooses threshold for next iteration such that at a proportion of at least 2 . 5% of the previously thresholded pairs become non - thresholded .
// sort in descending order // pick threshold that changes at least alpha*100 % of the pair-copulas