-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbernoulli.h
37 lines (32 loc) · 1.01 KB
/
bernoulli.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef LIKNORM_BERNOULLI_H
#define LIKNORM_BERNOULLI_H
#include "binomial.h"
/** Bernoulli log-partition function.
*
* Please, refer to the ``binomial_log_partition()`` function.
*/
static inline double liknorm_bernoulli_log_partition(const double theta)
{
return liknorm_binomial_log_partition(theta);
}
/** First derivative of the Bernoulli log-partition function.
*
* Please, refer to the ``binomial_log_partition_fderivative()`` function.
*/
static inline double
liknorm_bernoulli_log_partition_fderivative(const double theta)
{
return liknorm_binomial_log_partition_fderivative(theta);
}
/** Zeroth, first, and second derivatives of the Bernoulli log-partition
* function.
*
* Please, refer to the ``bernoulli_log_partition_fderivative()`` function.
*/
static inline void
liknorm_bernoulli_log_partition_derivatives(const double theta, double *b0,
double *logb1, double *logb2)
{
liknorm_binomial_log_partition_derivatives(theta, b0, logb1, logb2);
}
#endif