Skip to content
Prev 6491 / 12125 Next

[R-pkg-devel] BH windows compilation issues in R devel

thanks for the quick response Dirk,

I did more digging and found that the error is caused by a single line (in
bold bellow, commenting it out and defining log_lik = 0 does not trigger
the error) but I have absolutely no idea why it is creating the problems

#include "DTboost.h"
#include <util/nainf.h>
#include <cmath>
#include <rng/RNG.h>
#include <boost/math/distributions/non_central_t.hpp>

using std::vector;
using std::log;
using boost::math::non_central_t;
using boost::math::pdf;

namespace jags {
namespace weightedt {

DTboost::DTboost() : VectorDist("dnt_boost", 3) {}

// some additional functions

double DTboost::logDensity(double const *x, unsigned int length, PDFType
type,
 vector<double const *> const &par,
 vector<unsigned int> const &len,
 double const *lower, double const *upper) const
{
  // the sigma parameter is ignored
  double ncp   = *par[0];
  double df    = *par[2];

  // create the boost distribution
  non_central_t t_dist(df, ncp);

  // compute the log likelihood
*  double log_lik = log(pdf(t_dist, *x));*

  return log_lik;
}

// some additional functions
On Tue, 19 Jan 2021 at 22:32, Dirk Eddelbuettel <edd at debian.org> wrote: