Stan
1.3
probability, sampling & optimization
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerator
Friends
Macros
Pages
src
stan
math
functions
binary_log_loss.hpp
Go to the documentation of this file.
1
#ifndef __STAN__MATH__FUNCTIONS__BINARY_LOG_LOSS_HPP__
2
#define __STAN__MATH__FUNCTIONS__BINARY_LOG_LOSS_HPP__
3
4
#include <boost/math/tools/promotion.hpp>
5
6
namespace
stan {
7
namespace
math {
8
24
template
<
typename
T>
25
inline
typename
boost::math::tools::promote_args<T>::type
26
binary_log_loss
(
const
int
y,
const
T y_hat) {
27
using
std::log
;
28
return
-
log
(y ? y_hat : (1.0 - y_hat));
29
}
30
31
}
32
}
33
34
#endif
[
Stan Home Page
]
© 2011–2013, Stan Development Team.