soandso/forecast-verifiability
Composer 安装命令:
composer require soandso/forecast-verifiability
包简介
Weather forecast verifiability
README 文档
README
Forecast success is characterized by indicators called meteorological forecast success criteria. Success criteria are quantitative estimates of the compliance of actual and predictive weather characteristics.
Setup
Add the library to your composer.json file in your project:
{ "require": { "soandso/forecast-verifiability": "0.*" } }
Use composer to install the library:
$ php composer.phar install
Composer will install Forecast verifiability inside your vendor folder. Then you can add the following to your .php files to use the library with Autoloading.
require_once(__DIR__ . '/vendor/autoload.php');
You can also use composer on the command line to require and install Forecast verifiability:
$ php composer.phar require soandso/forecast-verifiability:0.*
Minimum Requirements
- PHP 7
Description
At the beginning, it is necessary to form a conjugacy matrix. To do this, you need to create an object of the ConjugacyMatrix class by giving the parameter the name of the meteorological value for which the assessment, e.g. wind:
$matrix = new ConjugacyMatrix('wind');
Next, fill in the values of the elements of the conjugacy matrix
$matrix->setN11(104); $matrix->setN12(12); $matrix->setN21(58); $matrix->setN22(369); $matrix->setN10($matrix->calcN10()); $matrix->setN20($matrix->calcN20()); $matrix->setN01($matrix->calcN01()); $matrix->setN02($matrix->calcN02()); $matrix->setN($matrix->calcN()); $matrix->setMatrix('n11', $matrix->getN11()); $matrix->setMatrix('n12', $matrix->getN12()); $matrix->setMatrix('n21', $matrix->getN21()); $matrix->setMatrix('n22', $matrix->getN22()); $matrix->setMatrix('n10', $matrix->getN10()); $matrix->setMatrix('n20', $matrix->getN20()); $matrix->setMatrix('n01', $matrix->getN01()); $matrix->setMatrix('n02', $matrix->getN02()); $matrix->setMatrix('N', $matrix->getN());
Taken designation of conjugacy matrix elements
| Forecasted manifestation of a phenomenon | Forecasted absence of a phenomenon | Total number of cases | |
|---|---|---|---|
| Observability of a phenomenon is observed | n11 | n12 | n10 |
| There is a lack of a phenomena | n21 | n22 | n20 |
| Total number of cases | n01 | n02 | N |
After the conjugacy matrix is constructed, individual criteria can be calculated. To do this, first create an object of the CriteriaForecast class by giving it the conjugacy matrix object
$criteria = new CriteriaForecast($matrix);
Calculation general forecast accuracy. Sets the name of the criterion (necessary for generating output)ю
$criteria->setNameCriteria('General forecast accuracy');
Valid list of criteria:
'General forecast accuracy' 'Forecast accuracy criterion' 'Forecast reliability criterion' 'Climate entropy' 'Conditional entropy' 'Amount of forecaste information' 'Information relation'
Sets criterion units
$criteria->setUnit('%');
Value calculation
$criteria->calclateP();
To generate a general conclusion (many different criteria can be calculated for one task), you need to add the result to a general container for output.
$criteria->setValueCriteria($criteria->getNameCriteria(), $criteria->getP(), $criteria->getUnit());
Calculation forecast accuracy criterion.
$criteria->setNameCriteria('Forecast accuracy criterion'); $criteria->calculateQ(); $criteria->setValueCriteria($criteria->getNameCriteria(), $criteria->getQ());
Calculation forecast reliability criterion.
$criteria->setNameCriteria('Forecast reliability criterion'); $criteria->calculateH(); $criteria->setValueCriteria($criteria->getNameCriteria(), $criteria->getH());
Calculation climate entropy.
$criteria->setNameCriteria('Climate entropy'); $criteria->calculateHf(); $criteria->setValueCriteria($criteria->getNameCriteria(), $criteria->getHf());
Calculation conditional entropy.
$criteria->setNameCriteria('Conditional entropy'); $criteria->calculateHp(); $criteria->setValueCriteria($criteria->getNameCriteria(), $criteria->getHp());
Calculation amount of forecaste information.
$criteria->setNameCriteria('Amount of forecaste information'); $criteria->calculateI(); $criteria->setValueCriteria($criteria->getNameCriteria(), $criteria->getI());
Calculation information relation.
$criteria->setNameCriteria('Information relation'); $criteria->calculateV(); $criteria->setValueCriteria($criteria->getNameCriteria(), $criteria->getV());
Get all values of criteria:
$criteria->getValueCriteries();
Get the value of a criterion by naming it:
$criteria->getValueCriteria('General forecast accuracy');
The output of the output function can be an array of the following form:
Array
(
[General forecast accuracy] => Array
(
[value] => 87.108655616943
[unit] => %
)
[Forecast accuracy criterion] => Array
(
[value] => 0.76072034240491
[unit] =>
)
[Forecast reliability criterion] => Array
(
[value] => 0.66472611802064
[unit] =>
)
...........................
)
Standards
Grouping conforms to the following standards:
- PSR-2 - Basic coding standard (https://www.php-fig.org/psr/psr-2/)
- PSR-4 - Autoloader (https://www.php-fig.org/psr/psr-4/)
- PSR-12 - Extended coding style guide (https://www.php-fig.org/psr/psr-12/)
License
Grouping is licensed under the GPLv2 License (https://www.gnu.org/licenses/old-licenses/gpl-2.0.html).
soandso/forecast-verifiability 适用场景与选型建议
soandso/forecast-verifiability 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 12 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 soandso/forecast-verifiability 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 soandso/forecast-verifiability 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 9
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 10
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2019-12-14