-
Notifications
You must be signed in to change notification settings - Fork 3
Statistical Analysis #9
Comments
While JS lacks native functionality, many NPM modules already fill this gap. See distributions, compute, and other affiliated organizations. The reality is JS will never have "native" support for everything, particularly for numeric and statistical computing, nor should we expect it to. Most Python and R functionality is provided by 3rd party libraries. We should expect something similar for JS. Further, even native Math functionality is a bit dodgy, as the specifications often never stipulate particular algorithms, precision, etc, leaving implementors to roll their own. What this means is that, across browsers, you can have discrepancies in results from, say, I would probably argue that most functionality should be left to 3rd party libraries, as 3rd party libraries can iterate much faster than standards committees. |
I think many of these are easily solved in userland, and should be. What this depends on is #7 and a high quality set of modules or a library. I don't see the lack of these functions in Javascript as a show stopper for doing statistical analysis. And something as simple as mean and mode have different interpretations depending on context. For example in inferential statistic sample mean is usually defined to be EDIT kgryte was that bit faster |
I am not arguing whether or not these should live in userland, rather that these are holes in the language. If someone wants to work towards improving standardization for scientific purposes, this is merely an area where it could be done. 😄 |
I was reading TC39 meeting notes recently and there was something to the effect of "the Math functions in JS have never really been formally standardized, we kind of just let the implementers decide what to do". There are downsides to this approach like Math.random. But my sense is that I think we're not going to see the Math stuff get overhauled too much by the standards bodies. However, it seems they are interested in providing new low level calls through things like SIMD or the 64 bit arithmetic proposal. I'd be interested in knowing what low level requirements are missing to implement great statistics libs in JS. One somewhat unique aspect of JS is that since it's pretty good at evented I/O it means streaming (or "on-line") stats algorithms could be worthwhile to implement in JS whereas in other languages managing evented I/O gets pretty complicated so people tend to stick with stats algorithms that buffer all the data into RAM and process it all at once. |
Re: low level requirements. 64-bit integers. The I think the biggest issue with the built-ins is at least getting the implementors to agree on minimum standards for precision and robustness. The fact that Re: streams. Yes, these have already been worked on. See, e.g., here, here, and other modules within the org. These APIs are going to change, but streaming stats was one of the original reasons I started work on building computational utilities in JS. Here, improving streams performance would be great. |
Here's a primitive example of the kind of thing people do these days - http://www.sumsar.net/blog/2015/12/bayes-js-a-small-library-for-doing-mcmc-in-the-browser/ |
JavaScript lacks native functionality for statistical analysis, even for the most basic of functions:
The text was updated successfully, but these errors were encountered: