PHP code example of soandso / forecast-verifiability

1. Go to this page and download the library: Download soandso/forecast-verifiability library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

soandso / forecast-verifiability example snippets



$matrix = new ConjugacyMatrix('wind');

$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());

$criteria = new CriteriaForecast($matrix);

$criteria->setNameCriteria('General forecast accuracy');

$criteria->setUnit('%');

$criteria->calclateP();

$criteria->setValueCriteria($criteria->getNameCriteria(), $criteria->getP(), $criteria->getUnit());

$criteria->setNameCriteria('Forecast accuracy criterion');
$criteria->calculateQ();
$criteria->setValueCriteria($criteria->getNameCriteria(), $criteria->getQ());

$criteria->setNameCriteria('Forecast reliability criterion');
$criteria->calculateH();
$criteria->setValueCriteria($criteria->getNameCriteria(), $criteria->getH());

$criteria->setNameCriteria('Climate entropy');
$criteria->calculateHf();
$criteria->setValueCriteria($criteria->getNameCriteria(), $criteria->getHf());

$criteria->setNameCriteria('Conditional entropy');
$criteria->calculateHp();
$criteria->setValueCriteria($criteria->getNameCriteria(), $criteria->getHp());

$criteria->setNameCriteria('Amount of forecaste information');
$criteria->calculateI();
$criteria->setValueCriteria($criteria->getNameCriteria(), $criteria->getI());

$criteria->setNameCriteria('Information relation');
$criteria->calculateV();
$criteria->setValueCriteria($criteria->getNameCriteria(), $criteria->getV());

$criteria->getValueCriteries();

$criteria->getValueCriteria('General forecast accuracy');
bash
$ php composer.phar install
bash
$ php composer.phar