PHP Trait MathPHP\Statistics\Regression\Models\LinearModel

Show file Open project: markrogoyski/math-php

Protected Properties

Property Type Description
$B
$M b parameter index

Public Methods

Method Description
evaluateModel ( number $x, array $params ) : number Evaluate the model given all the model parameters y = mx + b
getModelEquation ( array $params ) : string Get regression equation (y = mx + b)
getModelParameters ( array $params ) : array Get regression parameters (coefficients) m = slope b = y intercept

Method Details

evaluateModel() public static method

Evaluate the model given all the model parameters y = mx + b
public static evaluateModel ( number $x, array $params ) : number
$x number
$params array
return number y evaluated

getModelEquation() public static method

Get regression equation (y = mx + b)
public static getModelEquation ( array $params ) : string
$params array
return string

getModelParameters() public static method

Get regression parameters (coefficients) m = slope b = y intercept
public static getModelParameters ( array $params ) : array
$params array
return array [ m => number, b => number ]

Property Details

$B protected static property

protected static $B

$M protected static property

b parameter index
protected static $M