
Boost Users : 
Subject: [Boostusers] Using <boost/math/distributions/non_central_t.hpp> gives unexpected error
From: Avinash K. Hathiramani (a_hat__at_[hidden])
Date: 20120801 21:28:26
Hello,
I am new to using the Boost libraries and I was very happy to see that there is a noncentral t distribution class in Boost (I have not managed to find this anywhere else).
Unfortunately I am not able to use this without getting an error. Here is my code:
#include <boost/math/distributions/non_central_t.hpp>
using namespace std;
double nu = 3.0; double delta = 3.0; double x = 3.0;
boost::math::non_central_t_distribution<double> nct(delta, nu); double test_pdf = pdf(nct, x); double test_cdf = cdf(nct, x); cout << "Probability density of Student's t is " << test_cdf << endl; cout << "Cumulative probability of Student's t is " << test_cdf << endl;
This does not give any results and if I put in an error catch here, I get the following message:
"Error in function boost::math::gamma_p_derivative<e>(e, e): numeric overflow".
I do not follow what is going wrong and I am able to get results for both the CDF and PDF with the same parameters from MATLAB (and an online calculator which I found for this distribution), so I do not think that the parameters are invalid.
I would be grateful if anyone can advise me as to whether I am doing anything incorrectly here.
I apologise in advance if I have missed anything obvious, or unintentionally broken any of the discussion policies (it is my first time posting on this forum).
Thank you in advance for your help.
Kind regards,
Avinash
Boostusers list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net