bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
bitsim::maths::stats::BetaDist< RealType > Class Template Reference

The beta distribution is a real-valued distribution which produces values in the range [0, 1]. It has two parameters, alpha and beta. More...

#include <beta_dist.h>

Public Types

using result_type = RealType
 The return type every time we call pdf, sample.

Public Member Functions

 BetaDist (result_type alpha=1.0, result_type std=1.0)
 Constructor.
result_type pdf (result_type x) const
 compute the value of the PDF at the given point
result_type sample () const
 Sample from the distribution.
result_type sample (uint_t seed) const
 Sample from the distribution.
std::vector< result_type > sample_many (uint_t size) const
 sample from the distribution
std::vector< result_type > sample_many (uint_t size, uint_t seed) const
 sample from the distribution
result_type mean () const
 The mean value of the distribution see https://en.wikipedia.org/wiki/Beta_distribution.
result_type variance () const
 The variance of the distribution. see https://en.wikipedia.org/wiki/Beta_distribution.
result_type alpha () const
 Returns the alpha parameter of the distribution.
result_type beta () const
 Returns the beta parameter of the distribution.
void reset ()
 Reset the underlying distribution.
void reset (result_type a, result_type b)
 Reset the underlying distribution with new alpha beta.

Detailed Description

template<typename RealType = real_t>
class bitsim::maths::stats::BetaDist< RealType >

The beta distribution is a real-valued distribution which produces values in the range [0, 1]. It has two parameters, alpha and beta.

Member Typedef Documentation

◆ result_type

template<typename RealType = real_t>
using bitsim::maths::stats::BetaDist< RealType >::result_type = RealType

The return type every time we call pdf, sample.

Constructor & Destructor Documentation

◆ BetaDist()

template<typename RealType>
bitsim::maths::stats::BetaDist< RealType >::BetaDist ( result_type alpha = 1.0,
result_type std = 1.0 )
explicit

Constructor.

Member Function Documentation

◆ alpha()

template<typename RealType = real_t>
result_type bitsim::maths::stats::BetaDist< RealType >::alpha ( ) const
inline

Returns the alpha parameter of the distribution.

◆ beta()

template<typename RealType = real_t>
result_type bitsim::maths::stats::BetaDist< RealType >::beta ( ) const
inline

Returns the beta parameter of the distribution.

◆ mean()

template<typename RealType = real_t>
result_type bitsim::maths::stats::BetaDist< RealType >::mean ( ) const
inline

The mean value of the distribution see https://en.wikipedia.org/wiki/Beta_distribution.

◆ pdf()

template<typename RealType>
RealType bitsim::maths::stats::BetaDist< RealType >::pdf ( result_type x) const

compute the value of the PDF at the given point

◆ reset() [1/2]

template<typename RealType = real_t>
void bitsim::maths::stats::BetaDist< RealType >::reset ( )
inline

Reset the underlying distribution.

◆ reset() [2/2]

template<typename RealType>
void bitsim::maths::stats::BetaDist< RealType >::reset ( result_type a,
result_type b )

Reset the underlying distribution with new alpha beta.

◆ sample() [1/2]

template<typename RealType>
RealType bitsim::maths::stats::BetaDist< RealType >::sample ( ) const

Sample from the distribution.

◆ sample() [2/2]

template<typename RealType>
RealType bitsim::maths::stats::BetaDist< RealType >::sample ( uint_t seed) const

Sample from the distribution.

◆ sample_many() [1/2]

template<typename RealType>
std::vector< RealType > bitsim::maths::stats::BetaDist< RealType >::sample_many ( uint_t size) const

sample from the distribution

◆ sample_many() [2/2]

template<typename RealType>
std::vector< RealType > bitsim::maths::stats::BetaDist< RealType >::sample_many ( uint_t size,
uint_t seed ) const

sample from the distribution

◆ variance()

template<typename RealType>
RealType bitsim::maths::stats::BetaDist< RealType >::variance ( ) const

The variance of the distribution. see https://en.wikipedia.org/wiki/Beta_distribution.


The documentation for this class was generated from the following file: