https://github.com/hipek8/p6-statistics-linearregression
Statistics::LinearRegression - simple linear regression
https://github.com/hipek8/p6-statistics-linearregression
linear-regression perl6 statistics
Last synced: 4 months ago
JSON representation
Statistics::LinearRegression - simple linear regression
- Host: GitHub
- URL: https://github.com/hipek8/p6-statistics-linearregression
- Owner: hipek8
- License: artistic-2.0
- Created: 2016-11-17T16:24:02.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-24T12:09:42.000Z (about 9 years ago)
- Last Synced: 2025-03-13T23:13:36.878Z (over 1 year ago)
- Topics: linear-regression, perl6, statistics
- Language: Perl6
- Size: 8.79 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/hipek8/p6-Statistics-LinearRegression)
NAME
====
Statistics::LinearRegression - simple linear regression
SYNOPSIS
========
Gather some data
my @arguments = 1,2,3;
my @values = 3,2,1;
Build model and predict value for some x using object
use Statistics::LinearRegression;
my $x = 15;
my $y = my LR.new(@arguments, @values).at($x);
If you prefer bare functions, use :ALL
use Statistics::LinearRegression :ALL;
my ($slope, $intercept) = get-parameters(@arguments, @values);
my $x = 15;
my $y = value-at($x, $slope, $intercept);
DESCRIPTION
===========
LinearRegression finds slope and intercept parameters of linear function by minimizing mean square error.
Value at y is calculated using `y = slope × x + intercept`
TODO
====
* R^2 and p-value calculation
* support for other objective functions
CHANGES
=======
* 1.1.0 LR class exported by default, bare subroutines need :ALL
AUTHOR
======
Paweł Szulc
COPYRIGHT AND LICENSE
=====================
Copyright 2016 Paweł Szulc
This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.