STK++ 0.9.13
tutoProbability.cpp
Go to the documentation of this file.
1#include "STKpp.h"
2using namespace STK;
4int main(int argc, char** argv)
5{
6 Law::Normal l(2, 1);
7 stk_cout << "l.pdf(2)= " << l.pdf(2) << "\n";
8 stk_cout << "l.lpdf(2)= " << l.lpdf(2) << "\n";
9 stk_cout << "l.cdf(3.96)= " << l.cdf(3.96) << "\n";
10 stk_cout << "l.cdfc(3.96)= " << l.cdfc(3.96) << "\n";
11 stk_cout << "l.lcdf(3.96)= " << l.lcdf(3.96) << "\n";
12 stk_cout << "l.lcdfc(3.96)= "<< l.lcdfc(3.96)<< "\n";
13 stk_cout << "l.icdf(0.975)= "<< l.icdf(0.975)<< "\n";
14 stk_cout << "l.rand()= " << l.rand() << "\n";
15 CArray<Real, 2, 3> a; a = 0.5;
16 stk_cout << "-----------\n";
17 stk_cout << "a=\n" << a;
18 stk_cout << "a.pdf(l)=\n" << a.pdf(l);
19 stk_cout << "a.lpdf(l)=\n" << a.lpdf(l);
20 stk_cout << "a.cdf(l)=\n" << a.cdf(l);
21 stk_cout << "a.lcdf(l)=\n" << a.lcdf(l);
22 stk_cout << "a.cdfc(l)=\n" << a.cdfc(l);
23 stk_cout << "a.lcdfc(l)=\n"<< a.lcdfc(l);
24 stk_cout << "a.icdf(l)=\n" << a.icdf(l);
25}
#define stk_cout
Standard stk output stream.
This file include all the header files of the STK++ project.
A CArray is a two dimensional array with a continuous storage like a C-array.
Definition STK_CArray.h:130
UnaryOperator< Law::PdfOp< Type >, Derived > pdf(Law::IUnivLaw< Type > const &law) const
compute pdf values to this using distribution law given by user
UnaryOperator< Law::IcdfOp< Type >, Derived > icdf(Law::IUnivLaw< Type > const &law) const
compute inverse cumulative distribution function using distribution law given by user
UnaryOperator< Law::LogPdfOp< Type >, Derived > lpdf(Law::IUnivLaw< Type > const &law) const
compute log-pdf values to this using distribution law given by user
UnaryOperator< Law::LogCdfOp< Type >, Derived > lcdf(Law::IUnivLaw< Type > const &law) const
compute log-cumulative distribution function of this using distribution law given by user
UnaryOperator< Law::LogCdfcOp< Type >, Derived > lcdfc(Law::IUnivLaw< Type > const &law) const
compute complementary cumulative distribution function of this using distribution law given by user
UnaryOperator< Law::CdfcOp< Type >, Derived > cdfc(Law::IUnivLaw< Type > const &law) const
compute complementary cumulative distribution function of this using distribution law given by user
UnaryOperator< Law::CdfOp< Type >, Derived > cdf(Law::IUnivLaw< Type > const &law) const
compute cumulative distribution function of this using distribution law given by user
virtual Real cdfc(Real const &t) const
calculate the complement of cumulative distribution function, called in statistics the survival funct...
virtual Real lcdfc(Real const &t) const
calculate the log-complement of cumulative distribution function Give the log-probability that a rand...
virtual Real lcdf(Real const &t) const
compute the lower tail log-cumulative distribution function Give the log-probability that a random va...
Normal distribution law.
virtual Real lpdf(Real const &x) const
virtual Real icdf(Real const &p) const
Compute the inverse cumulative distribution function at p of the standard normal distribution.
virtual Real pdf(Real const &x) const
virtual Real cdf(Real const &t) const
Compute the cumulative distribution function at t of the standard normal distribution.
Real rand() const
Generate a pseudo Normal random variate.
The namespace STK is the main domain space of the Statistical ToolKit project.
int main(int argc, char **argv)