Skip to content

hipek8/p6-Statistics-LinearRegression

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
t
 
 
 
 
 
 
 
 
 
 
 
 

Build Status

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 pawel_szulc@onet.pl

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.

About

Statistics::LinearRegression - simple linear regression

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Other 100.0%