multivariate-normal-js | A Javascript / Node.JS port of NumPy | Runtime Evironment library
kandi X-RAY | multivariate-normal-js Summary
kandi X-RAY | multivariate-normal-js Summary
[TypeScript definitions on DefinitelyTyped] A pure-javascript port of NumPy’s random.multivariate_normal, for Node.js and the browser.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of multivariate-normal-js
multivariate-normal-js Key Features
multivariate-normal-js Examples and Code Snippets
Community Discussions
Trending Discussions on multivariate-normal-js
QUESTION
I am using multivariate-normal-js which is a port of NumPy's random.multivariate_normal
. However, I need to be able to produce deterministic results. Is there any way do to this?
ANSWER
Answered 2018-May-08 at 00:01multivariate-normal-js
uses the inverse transform method to generate samples from a standard normal distribution, and it uses Math.random()
to generate the uniformly distributed random inputs to the inverse transform. So to be able to reproduce a (pseudo-)random sequence, you would need to be able to set the random seed for Math.random()
. According to the documentation for Math.random()
, this is not possible.
So the short answer is no, you can't do it. But see Seeding the random number generator in Javascript and Seedable JavaScript random number generator (and maybe search for more recent discussions) if you want to try to work around that limitation of Math.random()
. If you did that, you would have to replace the call to Math.random()
at line 22 of distribution.js with the appropriate call of your "seedable" random number generator to generate a random value from the uniform distribution on [0, 1).
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install multivariate-normal-js
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page