# JavaScript/PHP libraries for calculating common

I am looking for a JavaScript or a PHP library to calculate common business/statistical metrics (e.g. Total, Avg, YTD, YoY, MoM, CAGR growth, standard deviation, regression line coordinates) from simple arrays/objects with a structure such as:

The idea is that I would just provide the arrays with some basic parameters (e.g. time period I'm interested in) and would get all the numbers crunched automatically in return.

Can anybody point me to a library they've used and trust from experience?