Math.NET Numerics
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

438 lines
29 KiB

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Pseudo-Random Numbers
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content="Math.NET Numerics, providing methods and algorithms for numerical computations in science, engineering and every day use. .Net 4, .Net 3.5, SL5, Win8, WP8, PCL 47 and 136, Mono, Xamarin Android/iOS."/>
<meta name="author" content="Christoph Ruegg, Marcus Cuda, Jurgen Van Gael"/>
<script src="https://code.jquery.com/jquery-1.8.0.js"></script>
<script src="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet"/>
<link type="text/css" rel="stylesheet" href="https://numerics.mathdotnet.com/content/style.css" />
<style>
#main table:not(.pre) {
border: 1px solid #dddddd;
max-width: 100%;
border-style: solid;
border-width: 1px;
border-color: gray;
border-collapse: collapse;
border-right-width: 1px;
border-bottom-width: 1px;
margin-top: 15px;
margin-bottom: 25px;
}
#main table:not(.pre) th, #main table:not(.pre) td {
border: 1px solid #dddddd;
padding: 6px;
}
#main table:not(.pre) th p, #main table:not(.pre) td p {
margin-bottom: 5px;
}
</style>
<script type="text/javascript" src="https://numerics.mathdotnet.com/content/tips.js"></script>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</head>
<body>
<div class="container">
<div class="masthead">
<ul class="nav nav-pills pull-right">
<li><a href="https://www.mathdotnet.com">Math.NET Project</a></li>
<li><a href="https://numerics.mathdotnet.com">Math.NET Numerics</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics">GitHub</a></li>
</ul>
<h3 class="muted">Math.NET Numerics</h3>
</div>
<hr />
<div class="row">
<div class="span9" id="main">
<h1><a name="Pseudo-Random-Numbers" class="anchor" href="#Pseudo-Random-Numbers">Pseudo-Random Numbers</a></h1>
<p>The .Net Framework base class library (BCL) includes a pseudo-random number generator
for non-cryptography use in the form of the <code>System.Random</code> class.
Math.NET Numerics provides a few alternatives with different characteristics
in randomness, bias, sequence length, performance and thread-safety. All these classes
inherit from <code>System.Random</code> so you can use them as a drop-in replacement
even in third-party code.</p>
<p>All random number generators (RNG) generate numbers in a uniform
distribution. In practice you often need to sample random numbers with a different
distribution, like a Gaussian or Poisson. You can do that with one of our probability
distribution classes, or in F# also using the <code>Sample</code> module. Once parametrized,
the distribution classes also provide a variety of other functionality around probability
distributions, like evaluating statistical distribution properties or functions.</p>
<h2><a name="Initialization" class="anchor" href="#Initialization">Initialization</a></h2>
<p>We need to reference Math.NET Numerics and open the namespaces for
random numbers and probability distributions:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">using</span> MathNet.Numerics.Random;
<span class="k">using</span> MathNet.Numerics.Distributions;
</code></pre></td></tr></table>
<h2><a name="Generating-Random-Numbers" class="anchor" href="#Generating-Random-Numbers">Generating Random Numbers</a></h2>
<p>Let's sample a few random values from a uniform distributed variable
<span class="math">\(X\sim\mathcal{U}(0,1)\)</span>, such that <span class="math">\(0 \le x &lt; 1\)</span>:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
<span class="l">12: </span>
<span class="l">13: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="c">// create an array with 1000 random values</span>
<span class="k">double</span>[] samples <span class="o">=</span> SystemRandomSource.Doubles(<span class="n">1000</span>);
<span class="c">// now overwrite the existing array with new random values</span>
SystemRandomSource.Doubles(samples);
<span class="c">// we can also create an infinite sequence of random values:</span>
IEnumerable&lt;<span class="k">double</span>&gt; sampleSeq <span class="o">=</span> SystemRandomSource.DoubleSequence();
<span class="c">// take a single random value</span>
System.Random rng <span class="o">=</span> SystemRandomSource.Default;
<span class="k">double</span> sample <span class="o">=</span> rng.NextDouble();
<span class="k">decimal</span> sampled <span class="o">=</span> rng.NextDecimal();
</code></pre></td></tr></table>
<p>In F# we can do exactly the same, or alternatively use the <code>Random</code> module:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
<span class="l">12: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span class="i">samples</span> <span class="o">=</span> <span class="i">Random</span><span class="o">.</span><span class="i">doubles</span> <span class="n">1000</span>
<span class="c">// overwrite the whole array with new random values</span>
<span class="i">Random</span><span class="o">.</span><span class="i">doubleFill</span> <span class="i">samples</span>
<span class="c">// create an infinite sequence:</span>
<span class="k">let</span> <span class="i">sampleSeq</span> <span class="o">=</span> <span class="i">Random</span><span class="o">.</span><span class="i">doubleSeq</span> ()
<span class="c">// take a single random value</span>
<span class="k">let</span> <span class="i">rng</span> <span class="o">=</span> <span class="i">Random</span><span class="o">.</span><span class="i">shared</span>
<span class="k">let</span> <span class="i">sample</span> <span class="o">=</span> <span class="i">rng</span><span class="o">.</span><span class="i">NextDouble</span>()
<span class="k">let</span> <span class="i">sampled</span> <span class="o">=</span> <span class="i">rng</span><span class="o">.</span><span class="i">NextDecimal</span>()
</code></pre></td>
</tr>
</table>
<p>If you have used the .Net BCL random number generators before, you have likely
noticed a few differences: we used special routines to create a full array or
sequence in one go, we were able to sample a decimal number, an we used static functions
and a shared default instance instead of creating our own instance.</p>
<p>Math.NET Numerics provides a few alternative random number generators in their own types.
For example, <code>MersenneTwister</code> implements the very popular mersenne twister algorithm. All these types
inherit from <code>System.Random</code>, are fully compatible to it and can also be used exactly the same way:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">System.Random random <span class="o">=</span> <span class="k">new</span> SystemRandomSource();
<span class="k">var</span> sample <span class="o">=</span> random.NextDouble();
</code></pre></td></tr></table>
<p>However, unlike System.Random they can be made thread safe, use much more reasonable
default seeds and have some convenient extra routines. The <code>SystemRandomSource</code> class that
was used above uses System.Random to generate random numbers internally - but with all the extras.</p>
<h2><a name="Full-Range-Integers-and-Decimal" class="anchor" href="#Full-Range-Integers-and-Decimal">Full Range Integers and Decimal</a></h2>
<p>Out of the box, <code>System.Random</code> only provides <code>Next</code> methods to sample integers
in the [0, Int.MaxValue) range and <code>NextDouble</code> for floating point numbers in the [0,1) interval.
Did you ever have a need to generate numbers of the full integer range including negative numbers,
or a <code>System.Decimal</code>? Extending discrete random numbers to different ranges or types is non-trivial
if the distribution should still be uniform over the chosen range. That's why we've added a few extensions
methods which are available on all RNGs (including System.Random itself):</p>
<ul>
<li><strong>NextInt64</strong> generates a 64 bit integer, uniform in the range [0, Long.MaxValue)</li>
<li><strong>NextDecimal</strong> generates a <code>System.Decimal</code>, uniform in the range [0.0, 1.0)</li>
<li><strong>NextFullRangeInt32</strong> generates a 32 bit integer, uniform in the range [Int.MinValue, Int.MaxValue]</li>
<li><strong>NextFullRangeInt64</strong> generates a 64 bit integer, uniform in the range [Long.MinValue, Long.MaxValue]</li>
</ul>
<h2><a name="Seeds" class="anchor" href="#Seeds">Seeds</a></h2>
<p>All RNGs can be initialized with a custom seed number. The same seed causes
the same number sequence to be generated, which can be very useful if you need results
to be reproducible, e.g. in testing/verification. The exception is cryptography,
where reproducible random number sequences would be a fatal security flaw,
so our crypto random source does not accept a seed.</p>
<p>In the code samples above we did not provide a seed, so a default seed was used.
If no seed is provided, <code>System.Random</code> uses a time based seed equivalent to the
one below. This means that all instances created within a short time-frame
(which typically spans about a thousand CPU clock cycles) will generate
exactly the same sequence. This can happen easily e.g. in parallel computing
and is often unwanted. That's why all Math.NET Numerics RNGs are by default
initialized with a robust seed taken from the <code>CryptoRandomSource</code> if available,
or else a combination of a random number from a shared RNG, the time and a Guid
(which are supposed to be generated uniquely, worldwide).</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span class="i">someTimeSeed</span> <span class="o">=</span> <span class="i">RandomSeed</span><span class="o">.</span><span class="i">Time</span>() <span class="c">// not recommended</span>
<span class="k">let</span> <span class="i">someGuidSeed</span> <span class="o">=</span> <span class="i">RandomSeed</span><span class="o">.</span><span class="i">Guid</span>()
<span class="k">let</span> <span class="i">someRobustSeed</span> <span class="o">=</span> <span class="i">RandomSeed</span><span class="o">.</span><span class="i">Robust</span>() <span class="c">// recommended, used by default</span>
</code></pre></td>
</tr>
</table>
<p>Let's generate random numbers like before, but this time with custom seed 42:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span class="i">samplesSeeded</span> <span class="o">=</span> <span class="i">Random</span><span class="o">.</span><span class="i">doublesSeed</span> <span class="n">42</span> <span class="n">1000</span>
<span class="i">Random</span><span class="o">.</span><span class="i">doubleFillSeed</span> <span class="n">42</span> <span class="i">samplesSeeded</span>
<span class="k">let</span> <span class="i">samplesSeqSeeded</span> <span class="o">=</span> <span class="i">Random</span><span class="o">.</span><span class="i">doubleSeqSeed</span> <span class="n">42</span>
</code></pre></td>
</tr>
</table>
<p>Or without the F# Random module, e.g. in C#:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span>[] samplesSeeded <span class="o">=</span> SystemRandomSource.Doubles(<span class="n">1000</span>, <span class="n">42</span>);
SystemRandomSource.Doubles(samplesSeeded, <span class="n">42</span>);
IEnumerable&lt;<span class="k">double</span>&gt; sampleSeqSeeded <span class="o">=</span> SystemRandomSource.DoubleSequence(<span class="n">42</span>);
</code></pre></td></tr></table>
<h2><a name="Uniform-Random-Number-Generators" class="anchor" href="#Uniform-Random-Number-Generators">Uniform Random Number Generators</a></h2>
<p>Up to now we've used only <code>SystemRandomSource</code>, but there's much more:</p>
<ul>
<li><strong>SystemRandomSource</strong>: Wraps the .NET System.Random to provide thread-safety</li>
<li><strong>CryptoRandomSource</strong>: Wraps the .NET RNGCryptoServiceProvider. <em>Not available in portable builds.</em></li>
<li><strong>MersenneTwister</strong>: Mersenne Twister 19937 generator</li>
<li><strong>Xorshift</strong>: Multiply-with-carry XOR-shift generator</li>
<li><strong>Mcg31m1</strong>: Multiplicative congruential generator using a modulus of 2^31-1 and a multiplier of 1132489760</li>
<li><strong>Mcg59</strong>: Multiplicative congruential generator using a modulus of 2^59 and a multiplier of 13^13</li>
<li><strong>WH1982</strong>: Wichmann-Hill's 1982 combined multiplicative congruential generator</li>
<li><strong>WH2006</strong>: Wichmann-Hill's 2006 combined multiplicative congruential generator</li>
<li><strong>Mrg32k3a</strong>: 32-bit combined multiple recursive generator with 2 components of order 3</li>
<li><strong>Palf</strong>: Parallel Additive Lagged Fibonacci generator</li>
</ul>
<p>Let's sample a few uniform random values using Mersenne Twister in C#:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="c">// Typical way with an instance:</span>
<span class="k">var</span> random <span class="o">=</span> <span class="k">new</span> MersenneTwister(<span class="n">42</span>); <span class="c">// seed 42</span>
<span class="k">int</span> sampleInt <span class="o">=</span> random.Next();
<span class="k">double</span> sampleDouble <span class="o">=</span> random.NextDouble();
<span class="k">decimal</span> sampleDecimal <span class="o">=</span> random.NextDecimal();
<span class="k">double</span>[] samples <span class="o">=</span> random.NextDoubles(<span class="n">1000</span>);
IEnumerable&lt;<span class="k">double</span>&gt; sampleSeq <span class="o">=</span> random.NextDoubleSequence();
<span class="c">// Simpler and faster if you need a large sequence, only once:</span>
<span class="k">double</span>[] samples <span class="o">=</span> MersenneTwister.Doubles(<span class="n">1000</span>, <span class="n">42</span>) <span class="c">// 1000 numbers, seed 42</span>
IEnumerable&lt;<span class="k">double</span>&gt; sampleSeq <span class="o">=</span> MersenneTwister.DoubleSequence(<span class="n">42</span>); <span class="c">// seed 42</span>
</code></pre></td></tr></table>
<p>In F# you can use the constructor as well, or alternatively use the <code>Random</code> module.
In case of the latter, all objects will be cast to their common base type <code>System.Random</code>:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
<span class="l">12: </span>
<span class="l">13: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="c">// By using the normal constructor (random1 has type MersenneTwister) </span>
<span class="k">let</span> <span class="i">random1</span> <span class="o">=</span> <span class="i">MersenneTwister</span>()
<span class="k">let</span> <span class="i">random1b</span> <span class="o">=</span> <span class="i">MersenneTwister</span>(<span class="n">42</span>) <span class="c">// with seed</span>
<span class="c">// By using the Random module (random2 has type System.Random)</span>
<span class="k">let</span> <span class="i">random2</span> <span class="o">=</span> <span class="i">Random</span><span class="o">.</span><span class="i">mersenneTwister</span> ()
<span class="k">let</span> <span class="i">random2b</span> <span class="o">=</span> <span class="i">Random</span><span class="o">.</span><span class="i">mersenneTwisterSeed</span> <span class="n">42</span> <span class="c">// with seed</span>
<span class="k">let</span> <span class="i">random2c</span> <span class="o">=</span> <span class="i">Random</span><span class="o">.</span><span class="i">mersenneTwisterWith</span> <span class="n">42</span> <span class="k">false</span> <span class="c">// opt-out of thread-safety</span>
<span class="c">// Using some other algorithms:</span>
<span class="k">let</span> <span class="i">random3</span> <span class="o">=</span> <span class="i">Random</span><span class="o">.</span><span class="i">crypto</span> ()
<span class="k">let</span> <span class="i">random4</span> <span class="o">=</span> <span class="i">Random</span><span class="o">.</span><span class="i">xorshift</span> ()
<span class="k">let</span> <span class="i">random5</span> <span class="o">=</span> <span class="i">Random</span><span class="o">.</span><span class="i">wh2006</span> ()
</code></pre></td>
</tr>
</table>
<h2><a name="Shared-Instances-and-Thread-Safety" class="anchor" href="#Shared-Instances-and-Thread-Safety">Shared Instances and Thread Safety</a></h2>
<p>Generators make certain claims about how many random numbers they can generate
until the whole sequence repeats itself. However, this only applies if you
continue to sample from the same instance and its internal state.
The generator instances should therefore be reused within an application if long
random sequences are needed. If you'd create a new instance each time, the numbers
it generates would be exactly as random as your seed - and thus not very random at all.</p>
<p>Another reason to share instances: most generators run an initialization routine before
they can start generating numbers which can be expensive. Some of them also maintain
their internal state in large memory blocks, which can quickly add up when creating multiple
instances.</p>
<p>Unfortunately the two generators provided by .NET are not thread-safe and thus cannot be
shared between threads without manual locking. But all the RNGs provided by Math.NET Numerics,
including the <code>SystemRandomSource</code> and <code>CryptoRandomSource</code> wrappers, <em>are</em> thread-safe by default,
unless explicitly disabled by a constructor argument or by setting <code>Control.ThreadSafeRandomNumberGenerators</code>
(which is used if the constructor argument is omitted).</p>
<p>For convenience a few generators provide a thread-safe shared instance</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">var</span> a <span class="o">=</span> SystemRandomSource.Default;
<span class="k">var</span> b <span class="o">=</span> MersenneTwister.Default;
</code></pre></td></tr></table>
<p>Or with the F# module:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span class="i">a</span> <span class="o">=</span> <span class="i">Random</span><span class="o">.</span><span class="i">systemShared</span>
<span class="k">let</span> <span class="i">b</span> <span class="o">=</span> <span class="i">Random</span><span class="o">.</span><span class="i">mersenneTwisterShared</span>
<span class="c">// or if you don&#39;t care, simply</span>
<span class="k">let</span> <span class="i">c</span> <span class="o">=</span> <span class="i">Random</span><span class="o">.</span><span class="i">shared</span>;
</code></pre></td>
</tr>
</table>
<h2><a name="Non-Uniform-Random-Numbers" class="anchor" href="#Non-Uniform-Random-Numbers">Non-Uniform Random Numbers</a></h2>
<p>For non-uniform random number generation you can use the wide range of probability
distributions in the <code>MathNet.Numerics.Distributions</code> namespace.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">using</span> MathNet.Numerics.Distributions;
<span class="c">// sample a single value from a standard distribution</span>
<span class="k">double</span> a <span class="o">=</span> Normal.Sample(<span class="n">0.0</span>, <span class="n">1.0</span>);
<span class="c">// sample using a custom random number generator</span>
<span class="k">double</span> b <span class="o">=</span> Normal.Sample(<span class="k">new</span> MersenneTwister(), <span class="n">0.0</span>, <span class="n">1.0</span>);
<span class="c">// sample a large number of values in one go</span>
<span class="k">double</span>[] c <span class="o">=</span> <span class="k">new</span> <span class="k">double</span>[<span class="n">100000</span>];
Normal.Samples(c, <span class="n">0.0</span>, <span class="n">1.0</span>);
</code></pre></td></tr></table>
<p>See <a href="Probability.html">Probability Distributions</a> for details.</p>
</div>
<div class="span3">
<ul class="nav nav-list" id="menu">
<li class="nav-header">Math.NET Numerics</li>
<li><a href="https://numerics.mathdotnet.com/Packages.html">NuGet & Binaries</a></li>
<li><a href="https://numerics.mathdotnet.com/ReleaseNotes.html">Release Notes</a></li>
<li><a href="https://numerics.mathdotnet.com/License.html">MIT/X11 License</a></li>
<li><a href="https://numerics.mathdotnet.com/Compatibility.html">Platform Support</a></li>
<li><a href="https://numerics.mathdotnet.com/api/">Class Reference</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics/issues">Issues & Bugs</a></li>
<li><a href="https://numerics.mathdotnet.com/Users.html">Who is using Math.NET?</a></li>
<li class="nav-header">Contributing</li>
<li><a href="https://numerics.mathdotnet.com/Contributors.html">Contributors</a></li>
<li><a href="https://numerics.mathdotnet.com/Contributing.html">Contributing</a></li>
<li><a href="https://numerics.mathdotnet.com/Build.html">Build & Tools</a></li>
<li><a href="http://feedback.mathdotnet.com/forums/2060-math-net-numerics">Your Ideas</a></li>
<li class="nav-header">Getting Help</li>
<li><a href="https://discuss.mathdotnet.com/c/numerics">Discuss</a></li>
<li><a href="https://stackoverflow.com/questions/tagged/mathdotnet">Stack Overflow</a></li>
<li class="nav-header">Getting Started</li>
<li><a href="https://numerics.mathdotnet.com/">Getting started</a></li>
<li><a href="https://numerics.mathdotnet.com/Constants.html">Constants</a></li>
<li>Floating-Point Numbers</li>
<li>Arbitrary Precision Numbers</li>
<li>Complex Numbers</li>
<li><a href="https://numerics.mathdotnet.com/Matrix.html">Matrices and Vectors</a></li>
<li><a href="https://numerics.mathdotnet.com/Euclid.html">Euclid & Number Theory</a></li>
<li>Combinatorics</li>
<li class="nav-header">Evaluation</li>
<li><a href="https://numerics.mathdotnet.com/Functions.html">Special Functions</a></li>
<li>Differentiation</li>
<li><a href="https://numerics.mathdotnet.com/Integration.html">Integration</a></li>
<li class="nav-header">Statistics/Probability</li>
<li><a href="https://numerics.mathdotnet.com/DescriptiveStatistics.html">Descriptive Statistics</a></li>
<li><a href="https://numerics.mathdotnet.com/Probability.html">Probability Distributions</a></li>
<li class="nav-header">Generation</li>
<li><a href="https://numerics.mathdotnet.com/Generate.html">Generating Data</a></li>
<li><a href="https://numerics.mathdotnet.com/Random.html">Random Numbers</a></li>
<li class="nav-header">Transformation</li>
<li>Fourier Transform (FFT)</li>
<li>Filtering & DSP</li>
<li>Window Functions</li>
<li class="nav-header">Solving Equations</li>
<li><a href="https://numerics.mathdotnet.com/LinearEquations.html">Linear Equation Systems</a></li>
<li>Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li>Linear Least Squares</li>
<li>Nonlinear Optimization</li>
<li><a href="https://numerics.mathdotnet.com/Distance.html">Distance Metrics</a></li>
<li class="nav-header">Curve Fitting</li>
<li><a href="https://numerics.mathdotnet.com/Regression.html">Regression</a></li>
<li>Interpolation</li>
<li>Fourier Approximation</li>
<li class="nav-header">Native Providers</li>
<li><a href="https://numerics.mathdotnet.com/MKL.html">Intel MKL</a></li>
<li class="nav-header">Working Together</li>
<li><a href="https://numerics.mathdotnet.com/CSV.html">Delimited Text Files (CSV)</a></li>
<li><a href="https://numerics.mathdotnet.com/MatrixMarket.html">NIST MatrixMarket</a></li>
<li><a href="https://numerics.mathdotnet.com/MatlabFiles.html">MATLAB</a></li>
<li><a href="https://numerics.mathdotnet.com/IFSharpNotebook.html">IF# Notebook</a></li>
<li>FsLab & Deedle</li>
<li>Microsoft Excel</li>
<li>numl.net machine learning</li>
<li>R-project</li>
</ul>
</div>
</div>
</div>
</body>
</html>