Evaluates the Angle distribution PDF.
Controller: CodeCogs
Contents
Dependents
Interface
C++
doublePDF( | double | x | |
int | n | )[inline] |
There is an error with your graph parameters for PDF with options x=0:3 n=3
Error Message:Function PDF failed. Ensure that: Invalid C++
Example 1
#include <codecogs/statistics/distributions/continuous/angle/pdf.h> #include <iostream> #include <iomanip> #define PRECISION 17 int main() { std::cout << "The values of the Angle PDF with n = 3 and"; std::cout << std::endl; std::cout << "x = {0, 0.2, 0.4, ..., 1.8, 2} are" << std::endl; std::cout << std::endl; for (double x = 0; x < 2.1; x += 0.2) { std::cout << std::setprecision(2); std::cout << "x = " << std::setw(3) << x << " : "; std::cout << std::setprecision(PRECISION); std::cout << Stats::Dists::Continuous::Angle::PDF(x, 3); std::cout << std::endl; } std::cout << std::endl; std::cout << "The mean of the Angle distribution is equal to"; std::cout << std::endl; std::cout << Stats::Dists::Continuous::Angle::mean; std::cout << std::endl; return 0; }
Output:The values of the Angle PDF with n = 3 and x = {0, 0.2, 0.4, ..., 1.8, 2} are x = 0 : 0 x = 0.2 : 0.099334665397530608 x = 0.4 : 0.19470917115432523 x = 0.6 : 0.28232123669751769 x = 0.8 : 0.35867804544976134 x = 1 : 0.4207354924039482 x = 1.2 : 0.46601954298361309 x = 1.4 : 0.49272486499422996 x = 1.6 : 0.49978680152075255 x = 1.8 : 0.48692381543909757 x = 2 : 0.45464871341284085 The mean of the Angle distribution is equal to 1.5707963267948966
References
- John Burkardt's library of statistical C++ routines, http://www.csit.fsu.edu/~burkardt/cpp_src/prob/prob.html
Parameters
x the argument of the PDF n the spatial dimension (must be at least 2)
Returns
- the value of the Angle PDF evaluated with the given arguments
Authors
- Lucian Bentea (September 2005)
Source Code
Source code is available when you agree to a GP Licence or buy a Commercial Licence.
Not a member, then Register with CodeCogs. Already a Member, then Login.