include/vinecopulib/misc/implementation/tools_interpolation.ipp
//! renormalizes the estimate to uniform margins
//!
//! @param times How many times the normalization routine should run.
renormalizes the estimate to uniform margins
renormalizes the estimate to uniform margins
inline void
InterpolationGrid::normalize_margins(int times)
{
  size_t m = grid_points_.size();
  for (int k = 0; k < times; ++k) {
    for (size_t i = 0; i < m; ++i) {
      values_.row(i) /= 
        std::max(int_on_grid(1.0, values_.row(i), grid_points_), 1e-20);
    }
    for (size_t j = 0; j < m; ++j) {
      values_.col(j) /= 
        std::max(int_on_grid(1.0, values_.col(j), grid_points_), 1e-20);
    }
  }
}
inline void InterpolationGrid :: normalize_margins ( int times ) { size_t m = grid_points_ . size ( ) ; for ( int k = 0 ; k < times ; ++ k ) { for ( size_t i = 0 ; i < m ; ++ i ) { values_ . row ( i ) /= std :: max ( int_on_grid ( 1.0 , values_ . row ( i ) , grid_points_ ) , 1e-20 ) ; } for ( size_t j = 0 ; j < m ; ++ j ) { values_ . col ( j ) /= std :: max ( int_on_grid ( 1.0 , values_ . col ( j ) , grid_points_ ) , 1e-20 ) ; } } }
renormalizes the estimate to uniform margins
renormalizes the estimate to uniform margins
// prevent 0/0 // prevent 0/0