lua examples/probability_helpers.lua#20
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR prepares LuaSF for
v0.7.0by implementing lightweight probability and combinatorics helpers.It builds on the modular source layout introduced in
v0.5.0and the shape statistics helpers added inv0.6.0.What changed
Implemented probability helpers
Implemented:
The module adds:
Combinatorics scope
This release makes the distinction between combinatorics without repetition and with repetition explicit:
Aliases were also added:
Added tests
Added:
The tests cover:
factorial(n)nPrandnCraliasesAdded example
Added:
The example demonstrates:
Added LuaRocks rockspec
Added:
The rockspec prepares LuaSF for the
v0.7.0LuaRocks package release.Updated workflows
Updated GitHub Actions workflows to include the new probability helper test and example:
Updated files:
Updated documentation
Updated documentation for the new helpers:
Compatibility notes
This PR does not remove or rename existing public functions.
Existing usage remains supported:
Legacy function names remain available.
Numeric precision note
Probability helpers use Lua numbers. Very large inputs may exceed the practical numeric precision or range of the Lua runtime.
Arbitrary-precision arithmetic is intentionally not included in this release to keep LuaSF small, pure-Lua, and dependency-light.
Testing
Test locally with:
Examples can be run with:
Release target
This PR prepares LuaSF for:
Scope note
LuaSF remains focused on lightweight statistics, probability helpers, random variables, sampling, and simulation utilities.
Optimization-based modeling, machine learning workflows, model training pipelines, and non-linear regression remain outside the current scope of LuaSF.