38#ifndef STK_MULTILAW_ITMULTILAW_H
39#define STK_MULTILAW_ITMULTILAW_H
59template<
class RowVector>
75 virtual Real pdf( RowVector
const& x)
const =0;
81 virtual Real lpdf( RowVector
const& x)
const =0;
86 virtual void rand( RowVector& x)
const =0;
99template<
class RowVector,
class Law>
103 typedef typename RowVector::Type
Type;
139 {
return std::exp((
double)
lpdf(x));}
150 for (
int j= x.begin();
j <= x.lastIdx(); ++
j)
158 virtual void rand( RowVector& x)
const
161 for (
int j= x.begin();
j <= x.lastIdx(); ++
j)
In this file we define and implement the final class Array1D.
In this file we define the interface base class for all multivariate probabilities laws ILawBase.
#define STKRUNTIME_ERROR_NO_ARG(Where, Error)
RowRange const & range() const
Derived & resize(Range const &I=RowRange())
Interface base class for all the (univariate/multivariate) probabilities laws.
ILawBase(String const &name)
Constructor.
String const & name() const
Interface base Class for the multivariate distributions.
virtual Real lpdf(RowVector const &x) const =0
compute the log probability distribution function Give the value of the log-pdf at the point x.
virtual void rand(RowVector &x) const =0
simulate a realization of the Multivariate Law and store the result in x.
virtual Real pdf(RowVector const &x) const =0
compute the probability distribution function (density) of the multivariate law.
virtual ~IMultiLaw()
destructor.
IMultiLaw(String const &name)
Constructor.
joint density class for the multivariate distributions.
Array1D< Law > const & JointLaw() const
IMultiLaw< RowVector > Base
virtual Real lpdf(RowVector const &x) const
compute the log probability distribution function Give the value of the log-pdf at the point x.
Law const & atLaw(int const &j) const
JointProbability(String const &name, int nbVar)
Constructor.
void resize(int const &nbVar)
resize the joint probability
JointProbability(String const &name)
Constructor.
Law & atLaw(int const &j)
Law const & law(int const &j) const
virtual ~JointProbability()
destructor
virtual void rand(RowVector &x) const
simulate a realization of the joint law and store the result in x.
virtual Real pdf(RowVector const &x) const
compute the probability distribution function (density) of the multivariate law.
Array1D< Law > jointLaw_
Array with the marginal laws.
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
Arrays::SumOp< Lhs, Rhs >::result_type sum(Lhs const &lhs, Rhs const &rhs)
convenience function for summing two arrays
std::basic_string< Char > String
STK fundamental type of a String.
double Real
STK fundamental type of Real values.
The namespace STK is the main domain space of the Statistical ToolKit project.
static bool isNA(Type const &x)