Questions tagged [numeric]

This tag is for questions concerning problems using numbers which either cannot be exactly solved, or where the exact solution may be much more difficult to acquire than by using numerical methods.

numeric
711 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6 votes
0 answers
768 views

Regression output is different on different computers

We are fitting a generalized linear model to a set of data using R on Fedora 33. We are 3 people that have the exact same data set, exact same OS (Fedora 33) , exact same R version and package version....
compIssues's user avatar
6 votes
1 answer
880 views

C# math library (System.Numerics vs Math.NET)

I'm trying to make my own game engine for learning purposes, but I'm also trying to make something that is optimized and is capable of handling a diverse amount of cross-platform games. That said, I'...
bootzin's user avatar
  • 161
6 votes
0 answers
1k views

Valgrind leading to numeric issues with long doubles

I have the following function in my code that checks numbers for having allowed values (in log space): template<class T> static void check_if_normal(T t) { T additive_neutral_element = ...
lo tolmencre's user avatar
  • 3,884
6 votes
0 answers
1k views

Confused about std::valarray slicing (slice_array, gslice_array, mask_array and indirect_array)

I want to get a std::valarray range that references a range of values from another valarray object without making copies of the values. The documentation states in relation to the index [] operator ...
quant's user avatar
  • 22.2k
5 votes
0 answers
328 views

How do I optimize numerical integration performance in Haskell (with example)

How do I optimize numerical integration routine (comparing to C)? What has been done to the moment: I replaced lists with unboxed vectors (obvious). I applied profiling techniques described in the ...
penkovsky's user avatar
  • 933
5 votes
1 answer
312 views

compiler-optimization for numerical stability

do GCC or similar compilers perform optimizations that are aimed at improving the numerical stability of floating-point operations. It is known that seemingly simply operations like addition or ...
shuhalo's user avatar
  • 6,272
4 votes
0 answers
795 views

R: Numerical integration returns a wrong result for a smooth function but does not fail completely

I got a very unlikely, but a very dangerous numerical error while integrating thousands of sufficiently well-behaved functions in R using the built-in integrate function. Story (can be skipped). My ...
Andreï V. Kostyrka's user avatar
4 votes
2 answers
5k views

Sort numbers with letters numerically and alphabetically

I have a Database on my website with a Long List of #'s (Product #'s) all containing letters (Exp. TC-345, TC-234 or HC-236W 123-234-PWD...) Can we numerically and alphabetically sort the #'s on the ...
Christina Glover's user avatar
4 votes
4 answers
3k views

Create a table with integer or numeric(4.0) in dBase width Jet.4

I want to create a table (.DBF file) with an Integer(4) field using Microsoft Jet dBase Provider. There is my code : Dim conn As New OleDb.OleDbConnection Dim comm As New OleDb.OleDbCommand ...
user avatar
4 votes
0 answers
5k views

Numerical integration - Boost vs GSL

I've found two good libraries for numerical integration in c++ that are easy enough for me to use. I have to integrate fairly complex functions with the possibility of singularities at endpoints and ...
Raul Laasner's user avatar
  • 1,515
3 votes
0 answers
146 views

Implementation of an algorithm for simultaneous diagonalization

I am trying to write an implementation of an algorithm for the simultaneous diagonalization of two matrices (which are assumed to be simultaneously diagonalizable). However, the algorithm does not ...
schade96's user avatar
  • 183
3 votes
1 answer
852 views

PROC SQL Numeric value 'NULL' is not recognized

I am trying to use case when statement to compare 2 columns with number and 'Null' value, the Proc SQL will return error as Numeric value 'NULL' is not recognized. How to fix my code? Data type for ...
Yumeng Xu's user avatar
  • 213
3 votes
1 answer
83 views

Does the average of floats satisfy conditions for machine-precision bisection?

Suppose you want to run a bisection algorithm/binary search down to machine precision, which will always terminate in a few hundred steps due to exponential halving of the range of floats. For this to ...
user11130854's user avatar
3 votes
0 answers
581 views

Python: Surface Integral over Mesh

Question How can I compute the surface integral of a specified function of the outer surface of a mesh in python? Code I tried to create a minimal workable example. In this example, I try to compute ...
henry's user avatar
  • 915
3 votes
0 answers
158 views

How to compute this numerical integral in Python?

I have a list of vectors: x = [x1, x2, x3, x4] where x1,.. are some variables. I have another matrix b = array([[0, 2], [0, 3], [1, 2], [1, 3], [2, 3]]) At the end I ...
matttree's user avatar
  • 135
3 votes
0 answers
172 views

base::chol() slows down when matrix contains many small entries

I've noticed that base::chol() severely slows down when the matrix contains many small elements. Here is an example: ## disable openMP library(RhpcBLASctl); blas_set_num_threads(1); ...
Nairolf's user avatar
  • 2,496
3 votes
0 answers
8k views

Convert numeric to string, keep decimal places in R

I have a field that is being read as numeric, with values that look something like this: "1234.00". I would like to convert this to a string, but preserve the trailing zeroes after the decimal place. ...
Parker's user avatar
  • 145
3 votes
0 answers
192 views

Scala - Numeric, Fractional fromLong and fromDouble

I was looking at Numeric and Fractional and I need the same thing that does fromInt method, but for Long and Double. Is there some way to achieve this? Why these methods are not present?
se7entyse7en's user avatar
  • 4,410
3 votes
0 answers
345 views

Sitecore lucene: How to index a property as a numeric field to enable range searches

Using Sitecore 8.2.1 I have defined a custom index patched into Sitecore's ContentSearch config. I have defined a computed fields 'MinPrice' and 'MaxPrice within the index. The fields appear in ...
Neil Jones's user avatar
3 votes
0 answers
740 views

Comparable Swift Numeric Types

Swift native numeric types (Int, Double, Float) conform to the Comparable protocol and so can be compared with ">" and "<" and similar operators. However, when comparing numeric variables; Int ...
Gerard de Jong's user avatar
3 votes
0 answers
418 views

double dispatch in swift for numeric types

Like many people I am trying to work with both integers and floating points and collections of these types. However the Swift type system is not always that forgivable. Most people define a Numeric ...
user965972's user avatar
  • 2,549
3 votes
1 answer
2k views

SQL Server - Text column contains number between

Can someone tell me how I code in SQL Server so that I am looking in a varchar text column to see if it contains a numerical range within the text? For example, I'm looking for columns that contain ...
DiMo's user avatar
  • 31
3 votes
1 answer
802 views

Solving double integral numerically in python

I am trying to solve a double integral numerically using areas of rectangles, where the integral looks like is just a function of two variables (theta and phi). Here's my attempt so far: from math ...
Matuba's user avatar
  • 53
3 votes
0 answers
715 views

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 ...
It'sNotALie.'s user avatar
  • 22.5k
3 votes
0 answers
4k views

How to programmatically show numeric keypad in android application

I am trying to port the android application(2.3.3) to BB 10,Presently input=number,is not showing numeric keypad,even though it filters appropriately,I tried list of methods to make it ...
Rakesh's user avatar
  • 15k
3 votes
2 answers
491 views

How to remove added done button from numeric keyboard

This is my code.... ` - ( void ) registerForKeyboardNotifications { [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardDidShowNotification object:nil]; [[...
NSUserDefault's user avatar
3 votes
0 answers
916 views

Set soft keyboard default to numeric on Android browser app using jQueryMobile

I want to be able to open the Android softkeyboard using Javascript in numeric mode. There are numerous posts out there about how to open the softkeyboard and about how to set its data type to ...
Wytze's user avatar
  • 7,874
3 votes
1 answer
1k views

android key listener doesn't respond to numbers

Has anyone else found that the key listener does not respond when numbers are pressed on keyboard or virtual keypad? I used a tutorial (broken link to whyandroid removed) and noticed that the only ...
Heather's user avatar
  • 31
3 votes
1 answer
5k views

Bypass php is_numeric() function is possible?

I am currently looking for a pass (not blind) high level of category sql injection application dvwa. Can not find the solution even if there are some ideas and tools that make life easier. source ...
Ephemeral's user avatar
  • 423
2 votes
0 answers
251 views

Error estimating DCC-GARCH using rmgarch in python

I have a dataframe consisting of log-returns for 5 assets, with no missing values etc. I am trying to estimate the DCC-GARCH(1,1) model using rmgarch in jupyter notebook. I already installed/imported ...
BKS's user avatar
  • 21
2 votes
1 answer
115 views

outliers detection and removal in a dataset with categorical and numerical variables

I am using the cardiotocography dataset and i have created a dataset of 9 variables and the categorical NSP variable but when i remove the outliers categories 2,3 are deleted in the NSP variable.How ...
Dbe's user avatar
  • 21
2 votes
4 answers
49 views

Column of mixed strings and numbers - need to conditionally convert strings to numerical format

I have a script that processes data from a CSV file, however sometimes one of the columns I am using from the CSV file randomly has some of its numbers enclosed in string characters thus making it a ...
verynovice's user avatar
2 votes
0 answers
52 views

I'm trying to forecast an ETS model using data from tsibbledata in R but I'm getting the error message seen at the bottom of the code below

ItalyExp <- global_economy %>% filter(Country == "Italy") ItalyExp$Exports <- as.numeric(as.character(ItalyExp$Exports)) ItalyExp %>% autoplot(Exports) + labs(title = "...
jaisoin's user avatar
  • 21
2 votes
0 answers
367 views

JavaScript: Sort a string that contains letters and numbers in a case-sensitive manner using Intl.Collator

With the requirement that I need to use the Intl.Collator (English language only) to sort strings that contains both letters and numbers (anywhere in the string). I need to have them sorted such that: ...
Russ's user avatar
  • 630
2 votes
0 answers
221 views

IEEE 754-2008 Decimal Floating Point. Why though?

IEEE 754-2008 added storage formats for decimal floating-point numbers, i.e. floating-point numbers with a radix of 10 instead of 2. IEEE 854 already defined operations on these kinds of numbers, but ...
Feuermurmel's user avatar
  • 9,716
2 votes
0 answers
50 views

Calculating with a numeric entry value

I am writing a GUI with tkinter, and I try to use an entry widget. Users should enter a numeric value within the entry box. Within the code I wrote a function which uses the entered numeric value in a ...
marlen's user avatar
  • 21
2 votes
0 answers
428 views

Output converter for converting DECIMAL('100.000') in pyodbc

I have numeric column in one of the SQL Server tables. When I tried retrieving the data from this table, the numeric value of 100.00 has been taken in Python as DECIMAL (100.000) which is preventing ...
Teja's user avatar
  • 39
2 votes
1 answer
519 views

Why do different step sizes produce large numerical error while approximating derivatives?

I'm attempting a bit of code that would help me approximate the derivatives of an arbitrary function. I saw there were four options on another post: Finite Differences Automatic Derivatives Symbolic ...
ThoughtOfGod's user avatar
2 votes
0 answers
1k views

How to convert negative values in variable, class <chr>, into numeric/integer without receiving NAs?

Thank you very much in advance for your help! In my dataframe(x) I want to convert the values in variable 1 and 2 into numerical/integer as well and also replace the "," into "." ...
AMoz's user avatar
  • 21
2 votes
0 answers
577 views

Calculate solid angle of polygon numerically

Suppose we have a polygon with coordinates ((x1, y1,z1), (x2,y2,z2), (x3,y3, z3), ...) and a point with coordinates (x0, y0,z0) Is there any numerical method to calculate solid angle of polygon about ...
Agile_Eagle's user avatar
  • 1,760
2 votes
1 answer
76 views

Numerical analysis of contact function - most efficient and easiest way to represent shapes

I'm doing a little assignment, as title suggest it's about numerical analysis of contact function, more specifically i'm looking for the closest distance between two points that are inside two ...
mannkin's user avatar
  • 29
2 votes
0 answers
1k views

Create an equilateral triangle mesh

I am looking for a numerically stable way to create an equilateral triangle mesh. My current approach is to generate the x coordinates of the vertices as i * 1/stepsize for even rows and stepsize/2 + ...
allo's user avatar
  • 4,027
2 votes
0 answers
65 views

Is it possible to loop to a certain value and carry on further calculations with this value?

I am new here and new in programming, so excuse me if the question is not formulated clearly enough. For a uni assignment, my labpartner and I are programming a predator-prey system. In this ...
Farah's user avatar
  • 21
2 votes
2 answers
634 views

arctan2 discrepancy in NumPy

I have come across a puzzling issue when using arctan2 in Numpy. Searching for atan2 errors did not answer the question, but someone might know the reason for this. f = np.arange(0,100) w = 2*np.pi*f/...
vlazzarini's user avatar
2 votes
0 answers
237 views

Converting uint64_t to double both up and down

I seek to convert a uint64_t to double. The problem is that uint64_t is not neccessarily exactly representable as a double for large uint64_t. So instead I want a range containing lowest and highest ...
Bomaz's user avatar
  • 1,891
2 votes
1 answer
1k views

Reading excel from c#, converts long numbers to exponential values

I am reading the Excel having a column of long numeric values of more than 8 digit. It also may start from 0 for example 003787677. Examples in my case are 173370148, 142350093 etc. The values in ...
Tipur Madan's user avatar
2 votes
0 answers
49 views

Numerical Stable way of implement norm2 loss function

I have a loss function mean{|| x^i - y^i ||^2} where x^i is i-th data point. || x^i - y^i ||^2 = sum_j (x^i_j - y^i_j)^2. (where x^i_j is the i-th data point's j-th variable) I could easily have one ...
ElleryL's user avatar
  • 527
2 votes
2 answers
428 views

Clustered bar chart R using 2 Numeric Variables/Metrics

I want to create a clustered Bar chart in R using 2 numeric variables, e.g: Movie Genre (X-axis) and Gross$ + Budget$ should be Y-axis It's a very straightforward chart to create in Excel. However, ...
Ashutosh D's user avatar
2 votes
1 answer
28 views

Extract numeric value in 1 column and add it in new index under parsed index

Many thanks for your helping, I have big problem that I have data frame like below: Name | Book | Location A | Mobile| Hai Long St. 123 B | Sim | Aha 123/456,78;9 I would like to separate ...
Long Bui Van's user avatar
2 votes
0 answers
1k views

Relative frequency histogram plot of a numeric variable in massive dataset

I have a numerical variable "myvariable" of 14e^06 elements which I want to plot a histogram to show the relative frequency of each bin. Considering the following sample data: set.seed(1234) wdata = ...
Seymour's user avatar
  • 3,184

1
2 3 4 5
15