PHP Class MathPHP\Statistics\Regression\PowerLaw

A functional relationship between two quantities, where a relative change in one quantity results in a proportional relative change in the other quantity, independent of the initial size of those quantities: one quantity varies as a power of another. https://en.wikipedia.org/wiki/Power_law y = Axᴮ Using least squares fitting: y = axᵇ n∑⟮ln xᵢ ln yᵢ⟯ − ∑⟮ln xᵢ⟯ ∑⟮ln yᵢ⟯ b = -------------------------------- n∑⟮ln xᵢ⟯² − ⟮∑⟮ln xᵢ⟯⟯² _ _ | ∑⟮ln yᵢ⟯ − b∑⟮ln xᵢ⟯ | a = exp| ------------------ | |_ n _|
Inheritance: extends ParametricRegression, use trait MathPHP\Statistics\Regression\Models\PowerModel, use trait MathPHP\Statistics\Regression\Methods\LeastSquares
Show file Open project: markrogoyski/math-php

Public Methods

Method Description
calculate ( ) Calculate the regression parameters by least squares on linearized data ln(y) = ln(A) + B*ln(x)

Method Details

calculate() public method

Calculate the regression parameters by least squares on linearized data ln(y) = ln(A) + B*ln(x)
public calculate ( )