I have forgotten
my Password

Or login with:

  • Facebookhttp://facebook.com/
  • Googlehttps://www.google.com/accounts/o8/id
  • Yahoohttps://me.yahoo.com
get GPL
COST (GBP)
this unit 0.75
sub units 3.00
+
0

PDF

Evaluates the Angle distribution PDF.
Controller: CodeCogs

Dependents

Info

Interface

C++

PDF

 
doublePDFdoublex
intn )[inline]
This component evaluates the PDF of the Angle distribution with given arguments. x is an angle between 0 and \inline  \pi, corresponding to the angle made in an n dimensional space, between a fixed line passing through the origin, and an arbitrary line that also passes through the origin, which is specified by choosing any point on the n dimensional sphere with uniform probability.

The Angle PDF is defined by the following formula

and for all

The mean of this distribution is given by

In the example that follows, the PDF is evaluated using a fixed value for n, equal to 3, while the first argument x takes values from 0 up to 2 with a step equal to 0.2. The mean of the distribution, stored as a constant inside the same namespace, is also displayed. The maximum number of precision digits, implicitly set to 17, may be changed through the PRECISION define.

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

xthe argument of the PDF
nthe 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.