Evaluates the variance of the Arcsin distribution PDF.

You're viewing an older version of this page (#308). View the current version.

View versions (2)

Interface

#include <codecogs/statistics/distributions/continuous/arcsin/variance.h>

using namespace Statistics::Distributions::Continuous::Arcsin;

This function evaluates the variance of the Arcsin distribution PDF with given argument, defined by

\sigma^2 = \frac{a^2}{2} \quad (\forall) a > 0
(1)

In the example that follows, the variance is evaluated using values of the parameter from 0.1 up to 0.8 with a step equal to 0.1. The maximum number of precision digits, implicitly set to 17, may be changed through the <em> PRECISION </em> define.

Example 1

#include <codecogs/stats/dists/continuous/arcsin/variance.h>
#include <iostream>
#include <iomanip>

#define PRECISION 17

int main()
{
  std::cout << "The variance of the Arcsin distribution PDF with";
  std::cout << std::endl;
  std::cout << "a = {0.1, 0.2, ... , 0.7, 0.8} is" << std::endl;
  std::cout << std::endl;
  for (double a = 0.1; a < 0.81; a += 0.1)
  {
    std::cout << std::setprecision(1);
    std::cout << "a = " << std::setw(3) << a << " : ";
    std::cout << std::setprecision(PRECISION);
    std::cout << Stats::Dists::Continuous::Arcsin::variance(a);
    std::cout << std::endl;
  }
  return 0;
}

Output

The variance of the Arcsin distribution PDF with
a = {0.1, 0.2, ... , 0.7, 0.8} is

a = 0.1 : 0.005000000000000001
a = 0.2 : 0.020000000000000004
a = 0.3 : 0.045000000000000012
a = 0.4 : 0.080000000000000016
a = 0.5 : 0.125
a = 0.6 : 0.17999999999999999
a = 0.7 : 0.24499999999999997
a = 0.8 : 0.31999999999999995

Parameters

a
the parameter of the PDF (must be stricly positive)

Returns

the variance of the Arcsin distribution PDF

References

John Burkardt&#039;s library of statistical C++ routines, http://www.csit.fsu.edu/~burkardt/cpp_src/prob/prob.html

GPL Licence — free for non commercial use. See Licence details.

Interactive Calculator

a
Result