Questions tagged [math.net]

This tag doesn't currently have an excerpt. Help contribute by writing one

256 questions
0
votes
0 answers

moving average difference between numpy and mathdotnet.com

First, a picture: Column A is my source data, 50 points. Column C and D are the SMA calculated with numpy and mathdotnet.com, respectively, with a window of 15. Column F is the delta. As we can see, about halfway, the data becomes identical, but…
Thomas
  • 10,933
  • 14
  • 65
  • 136
0
votes
1 answer

Why is a ByVal function changing my variable?

Calling divsig(h) results in changes to h. But divsig is a function that takes a matrix by value and not by reference. How can this happen? I'm trying to use the sig/divsig functions on matrices of data, for example: DenseMatrix 4x4-Double ' h…
0
votes
1 answer

Fit.Polynomial Show func

I'm using Fit.Polynomial to fit my data and show by graph, and all works great, but I couldn't find way to present my Y-function to any order. If the function is order 2 so I want it to be presents as y=ax^2+bx+c, and if the order is 3 so function…
0
votes
2 answers

Appending a 1 on the bottom of MathNet.Numerics.LinearAlgebra.Vector

I need to append a 1 on the bottom of an instance of the Vector class from MathNet.Numerics.LinearAlgebra namespace. Any help is appreciated (even suggestions for a different package for linear algebra).
huB1erTi2
  • 23
  • 5
0
votes
1 answer

How to create a dense matrix from uint[,] array

I am trying to create a DenseMatrix in MathDotNet from a uint array with two dimensions. uint[10,10] = myarray; Matrix newarray = Matrix.Build.DenseOfArray(myarray); Mathdotnet complains about this beeing not implemented yet. Only…
Georg W.
  • 1,292
  • 10
  • 27
0
votes
3 answers

Point-wise Multiply Column Array and Matrix using Math.Net Numerics with C#

I want to perform a point-wise multiplication of a column array with each column array/vector in a given Matrix in C# using the Math.Net Numerics library. There is little documentation on operations like this, so far I have the code below which…
JMan
  • 55
  • 3
  • 10
0
votes
3 answers

What parameters should I be using for the LogNormal and Normal Distribution in MATH.NET

I've tried several combinations of Mathdotnet's LogNormal and Normal classes: https://numerics.mathdotnet.com/api/MathNet.Numerics.Distributions/LogNormal. I seem to get a lot closer to the result I'm looking for using the mean and standard…
0
votes
1 answer

Using MathNet.Numerics to fit regression line through origin

I have two double arrays (double[] XValues, YValues) which contain physiological data. On these data I currently perform an 'unconstrained' linear regression using: Tuple r = Fit.Line(XValues, YValues); double YIntercept =…
Andy Pybus
  • 21
  • 2
0
votes
1 answer

Converting MathNet.Symbolics.ParseResult to MathNet.Symbolics.Expression

I have an issue trying to combine like terms for an expression using MathNet.Symbolics. For the following code, assume my 'cleanResponse' is '2.5q+3.5q=6q'. private static string CombineLikeTerms(string cleanResponse) { var root =…
Zach
  • 640
  • 1
  • 6
  • 16
0
votes
1 answer

Weighted multidim fit using Math.net numerics

I am using the Fit.LinearMultiDim method to fit a 4-parameter function to a multidimensional dataset (2-dim). More specific: I fit the function (x1,x2) => p1 + p2*x1 + p3*x1*x1 + p4*x2 FitParameters = Fit.LinearMultiDim(xy, z, d => 1.0, …
Dr. B
  • 41
  • 6
0
votes
1 answer

C# Math.Net - Polynomial Fit 3rd order produces unexpected equation?

I have a graph with 4 points: {0.0, 0.0}, {4687500.0, 10647580.9}, {4687500.1, 10647580.9}, {7500000.0, 10213609.9}, Using these points, in Excel I plot a 3rd order polynomial fit, which gives me the equation: y = -4E-14x3 + 2E-07x2 + 1.5x +…
FBryant87
  • 4,273
  • 2
  • 44
  • 72
0
votes
1 answer

Seeding F# random generator to same state as Matlab

In trying to port over some Matlab code to F#, I'm trying to make sure the translations are accurate. As of now, there are cases where I'm not completely sure whether there are mistakes. Since a lot of the code is statistical in nature, it would be…
0
votes
1 answer

Creating a Matrix in MathDotNet given a 2D array

I have the following code got from this site as a download from here. The full path after the zip file is extracted would be some thing like E:\Csharp2Dand3DTestbed\GraphicsBook\LA\LA\MatrixTransform2.cs protected static double[,]…
VivekDev
  • 20,868
  • 27
  • 132
  • 202
0
votes
1 answer

Translate operations on native types to Math.NET Numerics

In my effort to shift from using native F# types to Math.NET Numerics types an example would be most helpful. How would the following be expressed as an operation on DenseMatrix or DenseVector types? I've played around with the snippet below to…
0
votes
1 answer

array concatenation in F#

Are there any analogs to Matlab's horzcat() and vertcat() functions in F#? Because what I'm doing now seems asinine. There is a related question here but it seems pretty dated. let arr = Array.init 5 (fun i -> 1.) let xMat = DenseMatrix.init…