include/vinecopulib/bicop/implementation/abstract.ipp
//! evaluates the log-likelihood.
//! @param u Data matrix.
//! @param weights Optional weights for each observation.
evaluates the log-likelihood.
evaluates the log - likelihood .
inline double
AbstractBicop::loglik(const Eigen::MatrixXd& u, const Eigen::VectorXd weights)
{
  Eigen::MatrixXd log_pdf = this->pdf(u).array().log();
  if (weights.size() > 0) {
    log_pdf = log_pdf.cwiseProduct(weights);
  }
  tools_eigen::remove_nans(log_pdf);
  return log_pdf.sum();
}
inline double AbstractBicop :: loglik ( const Eigen :: MatrixXd & u , const Eigen :: VectorXd weights ) { Eigen :: MatrixXd log_pdf = this -> pdf ( u ) . array ( ) . log ( ) ; if ( weights . size ( ) > 0 ) { log_pdf = log_pdf . cwiseProduct ( weights ) ; } tools_eigen :: remove_nans ( log_pdf ) ; return log_pdf . sum ( ) ; }
evaluates the log-likelihood.
evaluates the log - likelihood .