Skip to content

mkewls/statistical-methods

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Statistical Methods in Javascript

Transparent Proxy Routes

This is a simple exercise in writing a transparent proxy that implements various statistical methods on time series data, where the provided date is ISO 8601 compliant and the value is a floating point number. More specifically, the imagined data is in the below form and the provided endpoints are Normalization, Z-Score, and Linear Combination. These functions are well-solved in Python using its great scientific libraries, but I thought an implementation in Javascript might be a decent challenge. Well, here it is!

[ {"date": "2014-03-01", "value": 45.555}, {...} ]

On that note, in a production environment, I would absolutely favor either a Node web-server networked to a Python codebase for the statistical computation, or a Python web-server framework such as Django or Flask directly bundled with the Python compute. Using Python also provides the advantage of ease of integration into powerful systems such as PySpark, which I believe would be advantageous at scale for this type of system.

Prerequisites

  • Node.js and npm
  • Data that meets the above form, either stored locally or (ideally) engaged from an API. Search the code for 'FILL IN HERE' to add the data location.

Installing dependencies

npm install

Running the app

The entry point for the web server is app.js. To start it up:

npm start

The port is set to 8080 and the app should be accessible upon start-up at the routes specified in the code comments.

About

Endpoints to turn time-series data into statistically useful information

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published