{"id":20217507,"url":"https://github.com/pforret/estimator","last_synced_at":"2025-03-03T11:26:32.182Z","repository":{"id":50465403,"uuid":"290708168","full_name":"pforret/estimator","owner":"pforret","description":"PHP package to help with statistic estimation","archived":false,"fork":false,"pushed_at":"2022-01-13T20:14:21.000Z","size":46,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-13T22:20:36.735Z","etag":null,"topics":["calculation","estimation","extrapolation","interpolation","statistics"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pforret.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-27T07:32:14.000Z","updated_at":"2022-07-29T10:53:06.000Z","dependencies_parsed_at":"2022-08-19T18:20:54.271Z","dependency_job_id":null,"html_url":"https://github.com/pforret/estimator","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":"toolstud-io/ts_php_template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pforret%2Festimator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pforret%2Festimator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pforret%2Festimator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pforret%2Festimator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pforret","download_url":"https://codeload.github.com/pforret/estimator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241654666,"owners_count":19997904,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["calculation","estimation","extrapolation","interpolation","statistics"],"created_at":"2024-11-14T06:34:21.201Z","updated_at":"2025-03-03T11:26:32.158Z","avatar_url":"https://github.com/pforret.png","language":"PHP","readme":"# Historical Estimator / Extrapolator\n\nGithub: \n![GitHub tag](https://img.shields.io/github/v/tag/pforret/estimator)\n![Tests](https://github.com/pforret/estimator/workflows/Run%20Tests/badge.svg)\n![Psalm](https://github.com/pforret/estimator/workflows/Detect%20Psalm%20warnings/badge.svg)\n![Styling](https://github.com/pforret/estimator/workflows/Check%20\u0026%20fix%20styling/badge.svg)\n\nPackagist: \n[![Packagist Version](https://img.shields.io/packagist/v/pforret/estimator.svg?style=flat-square)](https://packagist.org/packages/pforret/estimator)\n[![Packagist Downloads](https://img.shields.io/packagist/dt/pforret/estimator.svg?style=flat-square)](https://packagist.org/packages/pforret/estimator)\n\nPackage to help estimate stats based on partial data and historic averages.\n\nExample: \n* given the average rainfall in December in 20 cities for the last 5 years (e.g.86 mm for Brussels, ...)\n* when I have the rainfall this year for 15 of those cities, \n* estimate the other 5 cities\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require pforret/estimator\n```\n\n## Usage\n\n``` php\nuse Pforret\\Estimator\\Estimator;\n$est = new Estimator();\n$est-\u003eset_references($references);\n\n// and then\n\n$estimated = $est-\u003eestimate_from_partials($partials);\n\n// or \n\n$estimated = $est-\u003eestimate_from_total(100);\n```\n\n    $evaluation = $est-\u003eevaluate_partials($partials);\n\n    // references = values set with set_references\n    [references_count] =\u003e 4\n    [references_maximum] =\u003e 25\n    [references_mean] =\u003e 25\n    [references_median] =\u003e 25\n    [references_minimum] =\u003e 25\n    [references_sum] =\u003e 100\n    // partials = values specified with estimate_from_partials\n    [partials_maximum] =\u003e 28\n    [partials_mean] =\u003e 26\n    [partials_median] =\u003e 25\n    [partials_minimum] =\u003e 25\n    [partials_multiplier] =\u003e 1.04\n    [partials_sum] =\u003e 78\n    // found = subset of references, matching with partials keys\n    [found_count] =\u003e 3\n    [found_count_fraction] =\u003e 0.75\n    [found_mean] =\u003e 25\n    [found_sum] =\u003e 75\n    [found_sum_fraction] =\u003e 0.75\n    // stat = statistic evaulation of estimate/extrapolation\n    [stat_confidence] =\u003e 74.913\n    [stat_deviation] =\u003e 3\n\n## Example\n\n    $references=[\n        \"John\"  =\u003e  100,\n        \"Kevin\" =\u003e  120,\n        \"Sarah\" =\u003e  100,\n        \"Vince\" =\u003e  100,\n        ];\n    $est = new Estimator();\n    $est-\u003eset_references($references);\n    $partials=[\n        \"John\"  =\u003e 120,\n        \"Kevin\" =\u003e 150,\n        // \"Sarah\" is to be estimated\n        \"Vince\" =\u003e  175,\n        ];\n    $estimation=$est-\u003eestimate_from_partials();\n    /*\n        [John] =\u003e 120\n        [Kevin] =\u003e 150\n        [Vince] =\u003e 175\n        [Sarah] =\u003e 139 \u003c\u003c\u003c estimation\n    */\n    \n    \n    \n## Testing\n\n``` bash\ncomposer test\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## Security\n\nIf you discover any security related issues, please email author_email instead of using the issue tracker.\n\n## Credits\n\n- [Peter Forret](https://github.com/pforret)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpforret%2Festimator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpforret%2Festimator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpforret%2Festimator/lists"}