[57223f]: src / modules / glm / samplers / KS.h  Maximize  Restore  History

Download this file

32 lines (28 with data), 1.1 kB

 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
#ifndef KS_H_
#define KS_H_
class RNG;
namespace glm {
/**
* Utility function used by the HolmesHeld sampling method in
* binary logistic regression models.
*
* A variable "Z" with logistic distribution may be considered as
* a scale mixture of normal distributions with variance lambda,
* where lambda has a Kolmogorov-Smirnov distribution. Given Z,
* this function draws a sample from the posterior distribution of
* lambda.
*
* Although the posterior distribution of lambda given Z cannot
* be expressed in closed form, it can be efficiently sampled using
* a series approximation as described by Devroye (1986) Non-Uniform
* Random Variate Generation, Springer-Verlag, New York. Note that
* this book is currently available for free on line at
* http://luc.devroye.org/rnbookindex.html
*
* @param Z value of a random variable with logistic distribution
*
* @param rng Random number generator used for sampling
*/
double sample_lambda(double Z, RNG *rng);
}
#endif /* KS_H_ */

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks