Add simple regression summaries and Student t random variable#21
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.8.0by adding a Student's t random variable generator and formula-based simple linear regression summaries.It builds on the modular source layout, bivariate statistics, shape statistics, and probability helpers introduced in previous releases.
What changed
Added Student's t random variable generator
Added:
The Student's t random variable is generated using the standard relationship:
where
Zis an approximately standard normal random variable andVis a chi-square random variable withdfdegrees of freedom.Added simple regression module
Added:
The module exposes:
Regression summary output
simple_linear_regression(x, y)returns a formula-based regression summary including:Added tests
Added:
The tests cover:
Added examples
Added:
Added LuaRocks rockspec
Added:
Updated workflows
Updated GitHub Actions workflows to include:
The LuaRocks publishing workflow now defaults to:
Updated documentation
Updated:
Compatibility notes
This PR does not remove or rename existing public functions.
Existing usage remains supported:
Legacy LuaSF names remain available.
Testing
Tested locally with:
Examples can be run with:
Release target
This PR prepares LuaSF for:
Scope note
LuaSF now includes formula-based simple regression summaries, but it does not compute p-values, confidence intervals, critical values, multiple regression, non-linear regression, or machine learning workflows.
The goal remains to keep LuaSF lightweight, pure Lua, readable, and useful for statistics, probability, simulation, and teaching.