revisor/trend 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

revisor/trend

Composer 安装命令:

composer require revisor/trend

包简介

Analyze data and try to find a significant trend

README 文档

README

Latest Version on Packagist Software License Build Status Quality Score Coverage Status Total Downloads

Analyze data and try to find a significant trend.

Introduction

Imagine you're looking at points in a graph and you want to draw a single line through the points that represents their change. This is what Trend Calculator does. It tells you if there is a line through the points and how steep it is.

An example of linear regression

This class takes as an input a series of data points in time, performs regression, determines its statistical significance and returns a trend.

Time is the independent/explanatory variable, values are the dependent/outcome/target variable. In simplest terms:

"How does value change in time?"

Installation

Install Trend Calculator with the PHP package manager, Composer:

composer require revisor/trend

Usage

$trendCalculator = new TrendCalculator();

/**
 * $data is an array of arrays
 * In the inner arrays, keys are a time value in any unit (seconds, ie.
 * timestamp, microseconds, days, weeks...), the values are data values.
 * Multiple values for one point in time are allowed - maybe two events
 * occurred at one time.
 */
$data = [
    [1 => 9],
    [1 => 5],
    [2 => 12],
    [4 => 7]
];

/**
 * The resulting trend is a negative or positive float, or zero.
 * 
 * Values other than zero mean that there is a significant trend in the provided
 * data, and the trend goes down (for a negative number) or up (for a positive number).
 *
 * If the value is zero, it means that there is no significant trend.
 */
$trend = $trendCalculator->calculateTrend($data);

The slope of the trend is calculated by mcordingley/Regression. You can access more information about your data by asking the regression itself.

$regression = $trendCalculator->getRegression();
var_dump($regression->getStandardErrorCoefficients());

Change log

Please see the CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see the License for more information.

统计信息

  • 总下载量: 33
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-01-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固