Probability Density Function library In Solidity
paragraph.xyz Probability Density Function library In Solidity |
AI summary of the linked articleThe author describes a Solidity library for generating probability density functions (PDFs) for distribution markets, where traders bet on continuous outcomes rather than fixed options. The author says existing Solidity PDF libraries, including Solstat, Statistics Solidity and Solgauss, lacked features needed, such as support for arbitrary mean and sigma and operation at different scales. The library uses PRB-Math's SD59x18 signed fixed-point type, and it exposes functions including pdf, pdfDifference, isMinimumPoint, isMaximumPoint, pdfDerivativeAtX and pdfSecondDerivativeAtX. For x=3, μ=2, σ=1, the library computes 0.242, matching Desmos, and all tests run against reference values calculated in TypeScript. |
Recommended by 1 curator |
Comments No comments yetWhat caught your eye? Start the discussion. |
