Menu

Achieving Precision Equal to or Greater Than R in JavaScript: Fundamentals of Double-Double Arithmetic and Its Usage in rStats.js
📰

Achieving Precision Equal to or Greater Than R in JavaScript: Fundamentals of Double-Double Arithmetic and Its Usage in rStats.js

DEV Community: r·Naoyuki Umetani·6 days ago
#GZowLQ0f
#devtor#devto#dev#double#precision
Reading 0:00
15s threshold

rStats.js is a statistics library for JavaScript and the browser. Its function names, arguments, default values, and return values ​​are modeled after R, and every function has been tested by comparing its output against that of R. It covers areas such as probability distributions, random number generation, various statistical tests, analysis of variance (ANOVA), linear models, mixed-effects models, and survival analysis. It has no external dependencies and is released under the MIT License.

GitHub: https://github.com/numero-uno-jpn/rStats.js

Demo: https://numero-uno-jpn.github.io/rStats.js/demo/ (You can compare the results of all functions against the values ​​produced by R.)

npm: npm install @numero-uno-jpn/rstats

The background behind its creation and an overall introduction can be found in my previous article .

Why use "double-double" arithmetic?

In JavaScript, numbers are represented as 64-bit doubles, which provide a precision of approximately 16 decimal digits.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.