 Timestamp:
 Jun 18, 2008, 6:09:29 PM (15 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/yat/random/random.h
r1275 r1342 275 275 }; 276 276 277 / //278 ///@brief Discrete uniform distribution279 ///280 ///Discrete uniform distribution also known as the "equally likely281 ///outcomes" distribution. Each outcome, in this case an integer282 ///from [0,n1] , have equal probability to occur.283 ///284 ///Distribution function \f$ p(k) = \frac{1}{n+1} \f$ for \f$ 0 \le285 ///k < n \f$ \n286 ///Expectation value: \f$ \frac{n1}{2} \f$ \n287 ///Variance: \f$ \frac{1}{12}(n1)(n+1) \f$288 ///277 /** 278 @brief Discrete uniform distribution 279 280 Discrete uniform distribution also known as the "equally likely 281 outcomes" distribution. Each outcome, in this case an integer 282 from [0,n1] , have equal probability to occur. 283 284 Distribution function \f$ p(k) = \frac{1}{n+1} \f$ for \f$ 0 \le 285 k < n \f$ \n 286 Expectation value: \f$ \frac{n1}{2} \f$ \n 287 Variance: \f$ \frac{1}{12}(n1)(n+1) \f$ 288 */ 289 289 class DiscreteUniform : public Discrete 290 290 { … … 332 332 }; 333 333 334 / //335 ///@brief Poisson Distribution336 ///337 ///Having a Poisson process (i.e. no memory), number of occurences338 ///within a given time window is Poisson distributed. This339 ///distribution is the limit of a Binomial distribution when number340 ///of attempts is large, and the probability for one attempt to be341 ///succesful is small (in such a way that the expected number of342 ///succesful attempts is \f$ m \f$.343 ///344 ///Probability function \f$ p(k) = e^{m}\frac{m^k}{k!} \f$ for \f$ 0 \le345 ///k \f$ \n346 ///Expectation value: \f$ m \f$ \n347 ///Variance: \f$ m \f$348 ///334 /** 335 @brief Poisson Distribution 336 337 Having a Poisson process (i.e. no memory), number of occurences 338 within a given time window is Poisson distributed. This 339 distribution is the limit of a Binomial distribution when number 340 of attempts is large, and the probability for one attempt to be 341 succesful is small (in such a way that the expected number of 342 succesful attempts is \f$ m \f$. 343 344 Probability function \f$ p(k) = e^{m}\frac{m^k}{k!} \f$ for \f$ 0 \le 345 k \f$ \n 346 Expectation value: \f$ m \f$ \n 347 Variance: \f$ m \f$ 348 */ 349 349 class Poisson : public Discrete 350 350 { … … 413 413 /// @see seed, RNG::seed_from_devurandom, RNG::seed 414 414 /// 415 unsigned long seed_from_devurandom(void) { return rng_>seed_from_devurandom(); } 415 unsigned long seed_from_devurandom(void) 416 { return rng_>seed_from_devurandom(); } 416 417 417 418 /// … … 472 473 }; 473 474 474 / //475 /// @brief Generator of random numbers from an exponential476 ///distribution.477 ///478 ///The distribution function is \f$ f(x) = \frac{1}{m}\exp(x/a)479 ///\f$ for \f$ x \f$ with the expectation value \f$ m \f$ and480 ///variance \f$ m^2 \f$481 ///475 /** 476 \brief Generator of random numbers from an exponential 477 distribution. 478 479 The distribution function is \f$ f(x) = \frac{1}{m}\exp(x/a) 480 \f$ for \f$ x \f$ with the expectation value \f$ m \f$ and 481 variance \f$ m^2 \f$ 482 */ 482 483 class Exponential : public Continuous 483 484 { … … 507 508 }; 508 509 509 / //510 ///@brief Gaussian distribution511 ///512 /// Class for generating a random number from a Gaussian513 /// distribution between zero and unity. Utilizes the BoxMuller514 /// algorithm, whichneeds two calls to random generator.515 ///516 ///Distribution function \f$ f(x) =517 ///\frac{1}{\sqrt{2\pi\sigma^2}}\exp(\frac{(x\mu)^2}{2\sigma^2})518 ///\f$ \n519 ///Expectation value: \f$ \mu \f$ \n520 ///Variance: \f$ \sigma^2 \f$521 ///510 /** 511 @brief Gaussian distribution 512 513 Class for generating a random number from a Gaussian distribution 514 between zero and unity. Utilizes the BoxMuller algorithm, which 515 needs two calls to random generator. 516 517 Distribution function \f$ f(x) = 518 \frac{1}{\sqrt{2\pi\sigma^2}}\exp(\frac{(x\mu)^2}{2\sigma^2}) 519 \f$ \n 520 Expectation value: \f$ \mu \f$ \n 521 Variance: \f$ \sigma^2 \f$ 522 */ 522 523 class Gaussian : public Continuous 523 524 {
Note: See TracChangeset
for help on using the changeset viewer.