Download the PHP package aboks/power-iteration without Composer
On this page you can find all versions of the php package aboks/power-iteration. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download aboks/power-iteration
More information about aboks/power-iteration
Files in aboks/power-iteration
Package power-iteration
Short Description Implementation of the Power Iteration method for finding eigenvalues of a matrix, using math-php
License MIT
Informations about the package power-iteration
PowerIteration
Implementation of the Power Iteration method for finding (dominant) eigenvalues and the corresponding eigenvectors of a matrix, using the excellent math-php library.
Installation
Install using composer:
Basic usage
Advanced usage
Calculating the least dominant eigenpair
In most situations, one is interested in the dominant eigenvalue and its corresponding eigenvector. It is also possible to calculate the least dominant eigenpair however:
Customizations
Stopping criterion
By default, the power iteration runs for 1000 iterations. The stopping criterion can be altered by passing an instance of StoppingCriterion
as the first argument to PowerIteration
:
Scaling method
To prevent overflow in case of very large eigenvalues (or underflow in case of small eigenvalues), the eigenvector estimates are scaled/normalized after each iteration. The final eigenvector estimate is also scaled using the same method. By default, the estimates are scaled to a unit vector based on the L2-norm. To use a different method, provide an instance of ScalingMethod
as a second argument to PowerIteration
:
Running tests
After installing dependencies (including development dependencies) using Composer, run
from the project root dir.
Contributing
Contributions to this library are very welcome! Please make sure that your changes have sufficient test coverage, and that the code follows PSR-2.
Versioning
This project adheres to Semantic Versioning.
License
The code is released under the MIT license.