Download the PHP package dcvn/moving-average without Composer

On this page you can find all versions of the php package dcvn/moving-average. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package moving-average

GitHub license GitHub release

Moving Average

Calculate Moving Averages.

This package can help when you need moving averages in your PHP project.

For example, regular measurements of temperature or weight are not continuous; to have an idea of direction over time, a moving average is what you need.

To make numbers visual, I generated some example graphs for this doc.

You can also have a look at the tests for some usage examples.

Installation

Using composer: composer require dcvn/moving-average

Big or small data: Arrays and Generators

Statistics can have large data sets, and then Generators can help.

MovingAverage supports both Arrays and Generators for both input and output.

There are tests for all 4 variants. Use them to get started!

Average periods, delays, and weighted average.

The graphs below use this set of values:

1. No average

Calculate the "average" over a period of 1, you will get the exact same set of values:

Result values are equal to input values, because of period=1.

2. Average over the last n values

Calculate average over the current value and 3 previous values.

3. Weighted average over the last n values

Calculate average over the current value and 3 previous values, with different importance. In the example, current value is least important (w=1), previous value most (w=5).

4. Average over previous n, current, and next n values.

Calculate average over 5 values: previous 2, current, and next 2.

5. Weighted average over previous n, current, and next n values.

Calculate average over 5 values: previous 2, current, and next 2, with different importance. In the example, the current value is most important (w=5), past less (4, 2), future least (3, 1).


Graphs in this doc have been generated using JPGraph


All versions of moving-average with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package dcvn/moving-average contains the following files

Loading the files please wait ....