📄 nr02doc.htm
字号:
<td VALIGN="TOP">Derive a new class from <a HREF="#posgen">PosGen</a>, <a HREF="#symgen">SymGen</a> or <a HREF="#asymgen">AsymGen</a>, over-ride <i>Density</i>.</td> <td VALIGN="TOP">Gamma2</td> </tr> <tr> <td VALIGN="TOP">Can calculate inverse of distribution</td> <td VALIGN="TOP">Transform <a HREF="#random">uniform random</a> number.</td> <td VALIGN="TOP">Pareto</td> </tr> <tr> <td VALIGN="TOP">Transformation of supported random number</td> <td VALIGN="TOP">Derive a new class from the existing class</td> <td VALIGN="TOP">ChiSq1</td> </tr> <tr> <td VALIGN="TOP">Transformation of several random numbers</td> <td VALIGN="TOP">Derive new class from <a HREF="#random">Random</a>; generate the new random number from the existing generators.</td> <td VALIGN="TOP">ChiSq</td> </tr> <tr> <td VALIGN="TOP">Density with infinite singularity</td> <td VALIGN="TOP">Transform a random variable generated by <a HREF="#posgen">PosGen</a>, <a HREF="#symgen">SymGen</a> or <a HREF="#asymgen">AsymGen</a>.</td> <td VALIGN="TOP">Gamma1</td> </tr> <tr> <td VALIGN="TOP">Distribution with several modes</td> <td VALIGN="TOP">Breakdown into a <a HREF="#mixed">mixture</a> of unimodal distributions.</td> <td VALIGN="TOP"></td> </tr> <tr> <td VALIGN="TOP">Linear or quadratic combination of supported random numbers</td> <td VALIGN="TOP">Use <a HREF="#sum">SumRandom</a>.</td> <td VALIGN="TOP"></td> </tr> <tr> <td VALIGN="TOP">Mixture of supported random numbers</td> <td VALIGN="TOP">Use <a HREF="#mixed">MixedRandom</a>.</td> <td VALIGN="TOP"></td> </tr> <tr> <td VALIGN="TOP">Discrete distribution (< 100 possible values)</td> <td VALIGN="TOP">Use <a HREF="#discretegen">DiscreteGen</a>.</td> <td VALIGN="TOP">Poisson2</td> </tr> <tr> <td VALIGN="TOP">Discrete distribution (many possible values)</td> <td VALIGN="TOP">Use <a HREF="#posgen">PosGen</a>, <a HREF="#symgen">SymGen</a> or <a HREF="#asymgen">AsymGen</a>.</td> <td VALIGN="TOP">Poisson1</td> </tr></table><p> </p><h2><a NAME="other"></a>Other people's code:</h2><p>The gamma function is adapted from <i>Numerical Recipes in C</i>by Press, Flannery, Teukolsky, Vetterling published by the Cambridge University Press. The Shell sort and quick sort are adapted from <i>Algorithms in C++</i> by Sedgewick published by Addison Wesley.</p><p> </p><h2><a NAME="files"></a>Files included in this package:</h2><table BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="100%"> <tr> <td VALIGN="TOP">readme.txt</td> <td VALIGN="TOP">readme file</td> </tr> <tr> <td VALIGN="TOP">nr02doc.htm</td> <td VALIGN="TOP">this file</td> </tr> <tr> <td VALIGN="TOP">rbd.css</td> <td VALIGN="TOP">style sheet for newran02.htm</td> </tr> <tr> <td VALIGN="TOP">newran.h</td> <td VALIGN="TOP">header file for <i>newran</i></td> </tr> <tr> <td VALIGN="TOP">newran.cpp</td> <td VALIGN="TOP">main code file</td> </tr> <tr> <td VALIGN="TOP">extreal.h</td> <td VALIGN="TOP">header file for <i>extended reals</i></td> </tr> <tr> <td VALIGN="TOP">extreal.cpp</td> <td VALIGN="TOP">code file for <i>extended reals</i></td> </tr> <tr> <td VALIGN="TOP">boolean.h</td> <td VALIGN="TOP">definition of <i>bool</i></td> </tr> <tr> <td VALIGN="TOP">include.h</td> <td VALIGN="TOP">option file</td> </tr> <tr> <td VALIGN="TOP"><span lang="en-nz">tryrand.h</span></td> <td VALIGN="TOP"><span lang="en-nz">header file for tryrand</span></td> </tr> <tr> <td VALIGN="TOP">tryrand.cpp</td> <td VALIGN="TOP">test file</td> </tr> <tr> <td VALIGN="TOP">tryrand1.cpp</td> <td VALIGN="TOP">called by tryrand - histograms of simple examples</td> </tr> <tr> <td VALIGN="TOP">tryrand2.cpp</td> <td VALIGN="TOP">called by tryrand - histograms of advanced examples</td> </tr> <tr> <td VALIGN="TOP">tryrand3.cpp</td> <td VALIGN="TOP">called by tryrand - statistical tests</td> </tr> <tr> <td VALIGN="TOP">tryrand4.cpp</td> <td VALIGN="TOP">called by tryrand - test permutations</td> </tr> <tr> <td VALIGN="TOP">tryrand5.cpp</td> <td VALIGN="TOP">called by tryrand - test "vari" versions of generators</td> </tr> <tr> <td VALIGN="TOP">hist.cpp</td> <td VALIGN="TOP">called by tryrand - draw histogram</td> </tr> <tr> <td VALIGN="TOP">tryrand.txt</td> <td VALIGN="TOP">output from tryrand</td> </tr> <tr> <td VALIGN="TOP">nr_cc.mak</td> <td VALIGN="TOP">make file for CC compiler</td> </tr> <tr> <td VALIGN="TOP">nr_gnu.mak</td> <td VALIGN="TOP">make file for gnu G++ compiler</td> </tr> <tr> <td VALIGN="TOP">nr_b55.mak</td> <td VALIGN="TOP">make file for Borland 5.5 compiler</td> </tr></table><p> </p><h2><a NAME="class"></a>Class structure:</h2><p>The following diagram gives the class hierarchy of the package. </p><pre><b>ExtReal</b>.......................... <i>Extended real numbers</i><b>Random</b>........................... Uniform random number generator | +---Constant.................... Return a constant | +---PosGen...................... Used by PosGenX etc | | | +---PosGenX................ Positive random #s from decreasing density | | | +---Exponential............ Negative exponential rng | | | +---Gamma1................. Used by Gamma (shape parameter < 1) | | | +---SymGen................. Used by SymGenX etc | | | +---SymGenX........... Random numbers from symmetric density | | | +---Cauchy............ Cauchy random number generator | | | +---Normal............ Standard normal random number generator | | | +---ChiSq1....... Used by ChiSq (one df) | +---AsymGen..................... Used by AsymGenX etc | | | +---AsymGenX............... Random numbers from asymmetric density | | | +---Poisson1............... Used by Poisson (mean > 8) | | | +---Binomial1.............. Used by Binomial (n >= 40) | | | +---NegativeBinomial....... Negative binomial random number generator | | | +---Gamma2................. Used by Gamma (shape parameter > 1) | +---ChiSq....................... Non-central chi-squared rng | +---Gamma....................... Gamma random number generator | +---Pareto...................... Pareto random number generator | +---DiscreteGen................. Discrete random number generator | +---Poisson2.................... Used by Poisson (mean <= 8) | +---Binomial2................... Used by Binomial (n < 40) | +---Poisson..................... Poisson random number generator | +---Binomial.................... Binomial random number generator | +---SumRandom................... Sum of random numbers | +---MixedRandom................. Mixture of random numbers | +---MultipliedRandom............ Used by SumRandom | | | +---AddedRandom............ Used by SumRandom | | | +---SubtractedRandom....... Used by SumRandom | +---ShiftedRandom............... Used by SumRandom | | | +---ReverseShiftedRandom... Used by SumRandom | | | +---ScaledRandom........... Used by SumRandom | +---NegatedRandom.......... .... Used by SumRandom | +---RepeatedRandom.............. Used by SumRandom | +---AddedSelectedRandom......... Used by MixedRandom | +---SelectedRandom.............. Used by MixedRandom<b>RandomPermutation</b>................ Random permutation | +---RandomCombination........... Sorted random permutation</pre><pre><b>VariPoisson</b>...................... Poisson generator</pre><pre><b>VariBinomial</b>..................... Binomial generator</pre><pre><b>VariLogNormal</b>.................... Log normal generator</pre><p> </p><h2><a NAME="todo"></a>To do:</h2><ul> <li>More modern alternatives to the <a HREF="#random">LGM generator</a>;</li> <li>Additional generator classes;</li> <li>Better methods for combinations and permutations with large <tt>N</tt> and small <tt>M</tt>;</li> <li>Faster method for normal distribution</li> <li>Improve test program</li></ul><p> </p><h2><a name="history"></a>History:</h2><p>April, 2006 - make compatible with G++ 4.1 and VC++8 (you should also set the standard option in include.h with these compilers).</p><p>July, 2002 - bring into line with my other libraries; VariPoisson, VariBinomial, VariLogNormal classes; change to Sedgewick's Shell sort.</p><p>August, 1998 - update exception package; work around problem with MS VC++ 5</p><p>January, 1998 - version compatible with newmat09</p><p>1995 - <em>newran</em> version, additional distributions</p><p>1989 - initial version</p><hr><p><a HREF="#top">Go to top</a> </p><p><a HREF="ol_doc.htm">To online documentation page</a> </p></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -