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 _|
Afficher le fichier
Open project: markrogoyski/math-php
Méthodes publiques
Méthode |
Description |
|
calculate ( ) |
Calculate the regression parameters by least squares on linearized data
ln(y) = ln(A) + B*ln(x) |
|
Method Details
calculate()
public méthode
Calculate the regression parameters by least squares on linearized data
ln(y) = ln(A) + B*ln(x)