Math.NET Numericshttp://mathnetnumerics.codeplex.com/project/feeds/rssMath.NET Numerics is an open source numerical library for the .NET Framework and Mono.New Post: Instructions for redistributing MKL with solution that uses Native Providershttp://mathnetnumerics.codeplex.com/discussions/542931<div style="line-height: normal;">Ah! got it. Thanks, Christoph!<br />
</div>sfun28Wed, 23 Apr 2014 03:27:54 GMTNew Post: Instructions for redistributing MKL with solution that uses Native Providers 20140423032754ANew Post: Hypergeometric function not working correctlyhttp://mathnetnumerics.codeplex.com/discussions/542909<div style="line-height: normal;">Thanks for your fast response.
<br />
<br />
It fixed the position :)<br />
</div>mathsBeginnerWed, 23 Apr 2014 03:01:08 GMTNew Post: Hypergeometric function not working correctly 20140423030108ANew Post: Instructions for redistributing MKL with solution that uses Native Providershttp://mathnetnumerics.codeplex.com/discussions/542931<div style="line-height: normal;">There is no need to install anything. Assuming this is about Windows, just make sure both MathNet.Numerics.MKL.dll and libiomp5md.dll of the matching architecture (x86 vs x64) are in the same folder as your executable - just like on the development machine.
<br />
<br />
Thanks,
<br />
Christoph<br />
</div>cdrnetTue, 22 Apr 2014 22:49:46 GMTNew Post: Instructions for redistributing MKL with solution that uses Native Providers 20140422104946PNew Post: Is Creating 3D DenseMatrix in Math.NET Possible? http://mathnetnumerics.codeplex.com/discussions/542966<div style="line-height: normal;">No. In Math.NET Numerics, matrices are really just matrices, not generalized multidimensional array-like data structures or tensors like in NumPy or MATLAB.
<br />
<br />
Do you apply linear algebra routines to such a data structure, or is this more a way to organize a data set in a single data structure? If it is the latter, which is quite common in MATLAB in my experience e.g. to store a series of matrices, maybe an array or list of matrices would work as well?
<br />
<br />
Thanks,
<br />
Christoph<br />
</div>cdrnetTue, 22 Apr 2014 22:45:28 GMTNew Post: Is Creating 3D DenseMatrix in Math.NET Possible? 20140422104528PNew Post: Is Creating 3D DenseMatrix in Math.NET Possible? https://mathnetnumerics.codeplex.com/discussions/542966<div style="line-height: normal;">Is Creating 3D DenseMatrix in Math.NET Possible?
<br />
Like a 3x3x3 Matrix and initialize all elements to zero?
<br />
I need to simulate something like Matlab's zeros(XM,YM1,ZM1) functions. Any help will be appreciated.
<br />
Thanks.<br />
</div>debojyotidasTue, 22 Apr 2014 17:56:30 GMTNew Post: Is Creating 3D DenseMatrix in Math.NET Possible? 20140422055630PNew Post: Instructions for redistributing MKL with solution that uses Native Providershttp://mathnetnumerics.codeplex.com/discussions/542931<div style="line-height: normal;">Hello. I see that Intel provides redistribution rights when you license the MKL. My solution uses the Math.NET MKL Native Provider. How can I bundle the required MKL components so that my solution uses the MKL on a client machine where the MKL is not installed?<br />
</div>sfun28Tue, 22 Apr 2014 12:17:36 GMTNew Post: Instructions for redistributing MKL with solution that uses Native Providers 20140422121736PNew Post: Hypergeometric function not working correctlyhttp://mathnetnumerics.codeplex.com/discussions/542909<div style="line-height: normal;">There was a fix on the hyper-geometric CDF semantics in the v3 branch, so if it had been originally intended (or simply was a bug), it is no more.<br />
<br />
With the current v3.0.0-beta01:<br />
<pre><code>var hyper = new MathNet.Numerics.Distributions.Hypergeometric(30,15,10);
hyper.CumulativeDistribution(3); // returns 0.122538730634683
hyper.Probability(3).Dump(); // returns 0.0974512743628186</code></pre>
Can you upgrade to a v3 pre-release? There are plans to backport most fixes from v3 back to a v2 update, but I can't give any date on that.<br />
<br />
Btw, with v3 you can also do:<br />
<pre><code>Hypergeometric.CDF(30,15,10,3);
Hypergeometric.PMF(30,15,10,3);</code></pre>
Thanks,<br />
Christoph<br />
</div>cdrnetTue, 22 Apr 2014 08:55:36 GMTNew Post: Hypergeometric function not working correctly 20140422085536ANew Post: Hypergeometric function not working correctlyhttp://mathnetnumerics.codeplex.com/discussions/542909<div style="line-height: normal;">I tried to use Hypergeometric cummulative distribution in Math.Net like below:
<br />
<br />
var hyper = new MathNet.Numerics.Distributions.Hypergeometric(30,15,10);
<br />
Console.WriteLine ("{0},", hyper.CumulativeDistribution(3)); -->0.025087456
<br />
Console.WriteLine("{0},", hyper.Probability(3)); -->0.097451274
<br />
<br />
However, the result is different from excel Hypergeometric distribution function for the cummulative distribution. The Math.Net hyper.CumulativeDistribution (3) = Excel HYPEGEOM.DIST(2,10,15,30,1). Off by 1 position.
<br />
<br />
Excel: HYPEGEOM.DIST(3,10,15,30,1) = 0.122538731<br />
<pre><code> HYPEGEOM.DIST(3,10,15,30,0) = 0.097451274
</code></pre>
Please let me know whether it is intended to be like this or there is a mistakes in the calc.
<br />
<br />
Thanks.<br />
</div>mathsBeginnerTue, 22 Apr 2014 08:35:21 GMTNew Post: Hypergeometric function not working correctly 20140422083521ANew Post: Excel functions: PPMT,IPMT,PMT,CUMIPMT,CUMPRINChttp://mathnetnumerics.codeplex.com/discussions/542382<div style="line-height: normal;">They are not currently supported, but we happily accept contributions.
<br />
<br />
In the meantime <a href="https://github.com/fsprojects/ExcelFinancialFunctions" rel="nofollow">this</a> might be useful.
<br />
<br />
Thanks,
<br />
Christoph<br />
</div>cdrnetWed, 16 Apr 2014 08:46:13 GMTNew Post: Excel functions: PPMT,IPMT,PMT,CUMIPMT,CUMPRINC 20140416084613ANew Post: Excel functions: PPMT,IPMT,PMT,CUMIPMT,CUMPRINChttp://mathnetnumerics.codeplex.com/discussions/542382<div style="line-height: normal;">Dear Team,
<br />
<br />
We want to our application to support list of excel functions. Among those I could find that below functions are available in Math.Net library.
<br />
<em>NormInv,NormDist,NormSDist,NormSInv,BetaDist,BetaInv,</em>
<br />
<br />
I am unable to find any equivalent for following excel function:
<br />
PPMT,IPMT,PMT,CUMIPMT,CUMPRINC
<br />
<br />
Could you please let me know if Math.Net supports these functions?
<br />
<br />
Thanks
<br />
Shyam<br />
</div>shyampundkarWed, 16 Apr 2014 07:47:14 GMTNew Post: Excel functions: PPMT,IPMT,PMT,CUMIPMT,CUMPRINC 20140416074714ASource code checked in, #ad351778037037c05be65bbb5e0d71953fc7ff32http://mathnetnumerics.codeplex.com/SourceControl/changeset/ad351778037037c05be65bbb5e0d71953fc7ff32LA: drop F# Matrix.frobenius function Christoph RueggMon, 14 Apr 2014 02:20:46 GMTSource code checked in, #ad351778037037c05be65bbb5e0d71953fc7ff32 20140414022046ASource code checked in, #60bf40dcc0afc2b959afbfa913b7cef4d5e5a947http://mathnetnumerics.codeplex.com/SourceControl/changeset/60bf40dcc0afc2b959afbfa913b7cef4d5e5a947LA: iterative solver: delegate stop criterion, e.g. for interactive iteration Christoph RueggMon, 14 Apr 2014 02:13:21 GMTSource code checked in, #60bf40dcc0afc2b959afbfa913b7cef4d5e5a947 20140414021321ASource code checked in, #38fea05dcfa9cf772dabb555f87ed02aa43b23ffhttp://mathnetnumerics.codeplex.com/SourceControl/changeset/38fea05dcfa9cf772dabb555f87ed02aa43b23ffLA: make non-arithmetic instance members available as functions in F# Christoph RueggMon, 14 Apr 2014 02:05:07 GMTSource code checked in, #38fea05dcfa9cf772dabb555f87ed02aa43b23ff 20140414020507ANew Post: Bisection Rootshttp://mathnetnumerics.codeplex.com/discussions/542137<div style="line-height: normal;">I don't know recent VB very well, but the following seems to work in LinqPad:<br />
<pre><code>Dim f As Func(Of Double, Double) = Function(x) 2*x^2 - 2*x - 2
Bisection.FindRoot(f, 0, 2) ' 1.61803398874989
Bisection.FindRoot(f, -2, 0) ' -0.618033988749895</code></pre>
Thanks,
<br />
Christoph<br />
</div>cdrnetSun, 13 Apr 2014 19:16:35 GMTNew Post: Bisection Roots 20140413071635PNew Post: Bisection Rootshttp://mathnetnumerics.codeplex.com/discussions/542137<div style="line-height: normal;">Hi! I have a polynomial function from which I'd like to calculate the roots. Can anyone show me an example of such? I figured that I have to create a funtion of System.Func(Of Double, Double) type, but I have no clues about the way of doing that. A quick example with be very much appreciated.
<br />
<br />
Thanks in advance,
<br />
Nuno<br />
</div>ngasparSun, 13 Apr 2014 17:55:52 GMTNew Post: Bisection Roots 20140413055552PNew Post: Are units interesting?http://mathnetnumerics.codeplex.com/discussions/541697<div style="line-height: normal;">Yeah, very similar but for C# (nothing fancy).<br />
<br />
Sample:<br />
<pre><code>var av1 = new AngleUnitValue(90, AngleUnit.Degrees);
var av2 = new AngleUnitValue(Math.PI, AngleUnit.Radians);
var sum = av1 + av2;
Assert.AreEqual(270, sum.DegreesValue, 1E-6);</code></pre>
Names err on the poor/verbose side.<br />
</div>Johan20DWed, 09 Apr 2014 10:19:58 GMTNew Post: Are units interesting? 20140409101958ANew Post: Are units interesting?http://mathnetnumerics.codeplex.com/discussions/541697<div style="line-height: normal;">With units you're referring to <a href="http://msdn.microsoft.com/en-us/library/dd233243.aspx" rel="nofollow">F# Units of Measure</a> or something in this direction?<br />
</div>cdrnetWed, 09 Apr 2014 10:12:17 GMTNew Post: Are units interesting? 20140409101217ANew Post: Are units interesting?http://mathnetnumerics.codeplex.com/discussions/541697<div style="line-height: normal;">I often find that I want units, have written some stuff that I can make a pull request of if anyone is interested.<br />
</div>Johan20DWed, 09 Apr 2014 09:28:11 GMTNew Post: Are units interesting? 20140409092811ANew Post: MKL is even slowerhttp://mathnetnumerics.codeplex.com/discussions/541599<div style="line-height: normal;">Note that you're benchmarking a routine that takes roughly 100ns (1s = 1'000'000'000ns). For such short operations at some point the p/invoke and marshaling overhead to call from managed code into native code will dominate the timing entirely. If you only need short operations like this (as opposed to, say, large matrix multiplications or decompositions) then you may indeed end up with better performance with the managed provider.<br />
<br />
Also, your code still includes the first call (which includes JIT, MKL init etc) which will dominate the average for both providers. A small modification testing the same thing but measuring the first call separately (as Init) typically shows results like this on my machine for MKL:<br />
<pre><code>Intel MKL (x64; revision 4)
Create Data: 00:00:00.0127491s
Init: 2363400.000ns
A: 101.825ns
A: 102.201ns
A: 102.026ns
A: 101.821ns
A: 102.509ns</code></pre>
And for managed:<br />
<pre><code>Managed
Create Data: 00:00:00.0128457s
Init: 1948500.000ns
A: 168.284ns
A: 167.912ns
A: 168.293ns
A: 168.173ns
A: 168.143ns</code></pre>
Code:<br />
<pre><code>const int N = 100000;
Control.UseManaged();
//Control.UseNativeMKL();
Console.WriteLine(Control.LinearAlgebraProvider.ToString());
var w = Stopwatch.StartNew();
var uniform = new ContinuousUniform(-0.5, 0.5)
var a = Vector<double>.Build.Random(100, uniform);
var b = Vector<double>.Build.Random(100, uniform);
Console.WriteLine("Create Data: {0}s", w.Elapsed);
// we accumulate the results to make sure the compiler does not optimize it away.
w.Restart();
double x = a*b;
Console.WriteLine("Init: {0:0.000}ns", (w.Elapsed.TotalMilliseconds*1000*1000));
for (int k = 0; k < 5; k++)
{
w.Restart();
for (int i = 0; i < N; i++)
{
x += a*b;
}
Console.WriteLine("A: {0:0.000}ns", (w.Elapsed.TotalMilliseconds*1000*1000)/N);
}
Console.WriteLine(x);</code></pre>
Does this clarify things? Or do you see very different numbers in your setup?<br />
<br />
Thanks,<br />
Christoph<br />
</div>cdrnetWed, 09 Apr 2014 08:33:50 GMTNew Post: MKL is even slower 20140409083350ANew Post: MKL is even slowerhttp://mathnetnumerics.codeplex.com/discussions/541599<div style="line-height: normal;">I've thought about this too. So I changed my code to <br />
<pre><code>Control.LinearAlgebraProvider = new MklLinearAlgebraProvider();
ContinuousUniform uniform = new ContinuousUniform(-0.5, 0.5);
DenseVector a = DenseVector.CreateRandom(100, uniform);
DenseVector b = DenseVector.CreateRandom(100, uniform);
Stopwatch watch = new Stopwatch();
watch.Start();
for (int i = 0; i < 100000; i++) {
var c = a * b;
}
watch.Stop();
Console.WriteLine(watch.Elapsed);
</code></pre>
Still, MKL is much slower, according to the console output.
<br />
Is there anything else to be done rather than <code>Control.LinearAlgebraProvider = new MklLinearAlgebraProvider()</code>? E.g., configuring my CPU with some Intel tools?<br />
</div>YuhuanWed, 09 Apr 2014 03:19:24 GMTNew Post: MKL is even slower 20140409031924A