Questions tagged [numerics]

54 questions
3
votes
4 answers

Regression in SAS and R not matching

I'm trying to re-write a current SAS program of mine in R, and I'm checking the output to make sure it matches. I'm starting with a very basic regression, and I can't even get that to match. I also double-checked the results in Excel, and it…
user42719
  • 41
  • 1
  • 3
3
votes
2 answers

Why are the elements of the matrix and vector types in the F# Powerpack mutable?

F# is often promoted as a functional language where data is immutable by default, however the elements of the matrix and vector types in the F# Powerpack are mutable. Why is this? Furthermore, for which reason are sparse matrices implemented as…
Tuur
  • 115
  • 1
  • 3
3
votes
0 answers

How to implement a BigRational power method

I'm usning the BCL Codeplex implementation of BigRational, however it doesn't seem to have a Pow method that can take two BigRational, only one that takes a BigRational and a BigInteger. I'd write one myself, but I have no idea where to start.…
It'sNotALie.
  • 22,289
  • 12
  • 68
  • 103
2
votes
1 answer

Scala operations with Numeric generics

When I tried to do def subtract[T: Numeric](x: T, y: T) : T = x-y in Scala 2.12, the - is not recognized. However, this is basically equivalent to what Addition with generic type parameter in Scala suggests. What do I need to change?
frozen
  • 2,114
  • 14
  • 33
2
votes
1 answer

Logistic regression with NAs and factors returns error

I met the following two major problems when running logistic regression: My X variables includes factor variables, such as immigrant status (immigrant, non-immigrant); my Y variable is a binomial variable, low birth weight (non-lbw, lbw). I run the…
cyrusjan
  • 637
  • 1
  • 8
  • 23
2
votes
1 answer

add numerically the values of two vectors using Math.Net Numerics with C#

I have two vectors like the following: vdA = { 8.0, 7.0, 6.0 } vdB = { 0.0, 1.0, 2.0, 3.0 } I basicly want a vector vdX that result is to sum all element of vdA by all values of vdB. vdX = { 8.0, 9.0, 10.0 11.0, 7.0, 8.0, 9.0,…
LeMoussel
  • 5,290
  • 12
  • 69
  • 122
2
votes
4 answers

What numerical optimizers can operate with only gradients, and no explicit value of the objective?

I have an optimization problem that involves minimizing a function whose gradient I know, but the actual value of objective function at any point is unknown. I'd like to optimize the function using BFGS, but all of the BFGS implementations I've…
Robert T. McGibbon
  • 5,075
  • 3
  • 37
  • 45
1
vote
0 answers

Visual Studio 2010 - .Net Framework 4 Console Application

Basically I have added the System.Numerics reference to my project, and have added it to my using statements as below: However, I am getting the following error: The type or namespace name 'Numerics' does not exist in the namespace 'System' This…
JMK
  • 27,273
  • 52
  • 163
  • 280
1
vote
2 answers

Java resources to do number crunching?

What are the best resources on learning 'number crunching' using Java ? I am referring to things like correct methods of decimal number processing , best practices , API , notable idioms for performance and common pitfalls ( and their solutions )…
Bhaskar
  • 7,443
  • 5
  • 39
  • 51
1
vote
6 answers

Using Decimal or Hexadecimal Bases in .NET

Good morning, afternoon or night, Forewarning: I know that this may sound like I am trying to do premature optimization, but I assure you I am not. That being, please answer this question if you would like to to the best of your ability without…
Miguel
  • 3,466
  • 8
  • 38
  • 67
1
vote
2 answers

Issue with a generic dictionary of operations

I have a dictionary of operations: type INumerics<'T> = abstract Zer : 'T abstract Add : 'T * 'T -> 'T abstract Sub : 'T * 'T -> 'T abstract Mul : 'T * 'T -> 'T abstract Div : 'T * 'T -> 'T abstract Neq : 'T * 'T -> bool With helper…
Sasha Babaei
  • 455
  • 3
  • 8
1
vote
0 answers

Using Newton-Raphson method to solve the hydrostatic equation

I'm trying to use newton-raphson method for nonlinear systems of equations as discribed in 'Numerical recipies' book in chapter 9.6 to solve the hydrostatic equetion for a polytropic star. For each iteration, I change the radius vector as discribed…
Noam Chai
  • 167
  • 1
  • 10
1
vote
2 answers

MathNet Numerics - Fourier - "Specified method not supported"

I have a C# application, I installed MathNet.Numerics 3.17.0 via Nuget. I am trying to use the fourier functions. When I run this line of code: Fourier.Forward2D(n); It throws an exception "Specified method not…
Alex Martin
  • 156
  • 9
1
vote
1 answer

Math.Net Numerics, normal distributions vs EXCEL functions

I am planning to use Math.NET Numerics library when porting functionality from EXCEL sheet calculator to a c# program. in Excel there is excessive use of the function NORM.S.DIST(Z;bCummelative) where z is the number of standard dev from mean. I…
Thor P
  • 11
  • 3
1
vote
2 answers

combine histograms in gnuplot (weighted average of bin counts)

let us say I have two pieces of data for the same quantity, each coming with its error. In particular I have two histograms in gnuplot files roughly in the format xA yA dyA for histogram A xB yB dyB for histogram B (the xA and the xB values are the…
Rho Phi
  • 1,182
  • 1
  • 12
  • 21