Domain and value casts

template<typename TargetDomain, typename SourceDomain, typename Value, typename Validator>
likelihood< TargetDomain,
Value, Validator > 
boost::probabilities::domain_cast (const likelihood< SourceDomain, Value, Validator > &l)
 Cast domain of operations.
template<typename TargetDomain, typename SourceDomain, typename Value, typename Validator>
likelihood< TargetDomain,
Value, Validator >::value_type 
boost::probabilities::value_cast (const likelihood< SourceDomain, Value, Validator > &l)
 Cast the value of a likelihood.
template<typename TargetDomain, typename SourceDomain, typename Value, typename Validator>
probability< TargetDomain,
Value, Validator > 
boost::probabilities::domain_cast (const probability< SourceDomain, Value, Validator > &p)
 Cast domain of operations.
template<typename TargetDomain, typename SourceDomain, typename Value, typename Validator>
probability< TargetDomain,
Value, Validator >::value_type 
boost::probabilities::value_cast (const probability< SourceDomain, Value, Validator > &p)
 Cast the value of a probability.

Detailed Description

Likelihoods and probabilities are usable in two distinct domains, the native boost::probabilities::linear_domain and the boost::probabilities::log_domain. Consequently, it is necessary to transform quantities from one domain to the other. Additionally, it is necessary to extract the value of a likelihood or probability with specific reference to the relevant domain. These casts provide a systematic means of performing these operations.

Function Documentation

template<typename TargetDomain, typename SourceDomain, typename Value, typename Validator>
probability<TargetDomain,Value,Validator> boost::probabilities::domain_cast const probability< SourceDomain, Value, Validator > &  p  ) 
 

Cast domain of operations.

Parameters:
p probability
This function creates a new probability object as a copy of p but cast into the domain specified by the template argument TargetDomain. Appropriate domain types are linear_domain and log_domain.

template<typename TargetDomain, typename SourceDomain, typename Value, typename Validator>
likelihood<TargetDomain,Value,Validator> boost::probabilities::domain_cast const likelihood< SourceDomain, Value, Validator > &  l  ) 
 

Cast domain of operations.

Parameters:
l likelihood
This function creates a new probability object as a copy of l but cast into the domain specified by the template argument TargetDomain. Appropriate domain types are linear_domain and log_domain.

template<typename TargetDomain, typename SourceDomain, typename Value, typename Validator>
probability<TargetDomain,Value,Validator>::value_type boost::probabilities::value_cast const probability< SourceDomain, Value, Validator > &  p  ) 
 

Cast the value of a probability.

Parameters:
p probability
This function creates an object representing only the value of the probability p, but cast into the domain specified by the template argument TargetDomain. This is useful, for example, to inspect the value of a probability object and ensure that the value is represented within a particular domain. It may also be useful if further calculations must be performed on the value that do not, for example, result in a probability. Appropriate domain types are linear_domain and log_domain.

template<typename TargetDomain, typename SourceDomain, typename Value, typename Validator>
likelihood<TargetDomain,Value,Validator>::value_type boost::probabilities::value_cast const likelihood< SourceDomain, Value, Validator > &  l  ) 
 

Cast the value of a likelihood.

Parameters:
l likelihood
This function creates an object representing only the value of the likelihood l, but cast into the domain specified by the template argument TargetDomain. This is useful, for example, to inspect the value of a likelihood object and ensure that the value is represented within a particular domain. It may also be useful if further calculations must be performed on the value that do not, for example, result in a likelihood. Appropriate domain types are linear_domain and log_domain.


Generated on Thu Oct 18 11:10:28 2007 for Boost.Probability: C++ Probability and Likelihood Library by  doxygen 1.4.5