[Rcpp-devel] pnorm/qnorm?

Dirk Eddelbuettel edd at debian.org
Fri Sep 7 18:53:32 CEST 2012


On 7 September 2012 at 10:51, Rodney Sparapani wrote:
| There must be something that I am totally missing with respect to
| pnorm/qnorm.  Is there a more clever way to write
| Rcpp::stats::qnorm_0(x, 1, 0) or Rcpp::stats::pnorm_0(x, 1, 0)?
| Have I over-looked some docs for these?  I've been using Rcpp heavily
| for the last month and really enjoying it!

As a general, looking at the unit test files can be helpful. Here is one for qnorm:

  "runit_qnorm_prob" = list(
  signature( x = "numeric" ),
  '
  NumericVector xx(x) ;
  return List::create(_["lower"] = qnorm( xx, 0.0, 1.0 ),
  		      _["upper"] = qnorm( xx, 0.0, 1.0, false));
  ')

Ie you can just call 'pnorm', 'qnorm', ... 

Dirk


-- 
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com  


More information about the Rcpp-devel mailing list