UNPKG

@wmfs/tymly-rankings-plugin

Version:

Plugin which handles ranking of data for Tymly framework

15 lines (10 loc) 601 B
'use strict' const temporaryRiskScore = require('./temporary-risk-score') const growthCurveIntersection = require('./growth-curve-intersection') const calculateGrowthCurve = require('./calculate-growth-curve') module.exports = function calculateNewRiskScore (riskScore, range, daysElapsed, mean, stdev, exp, logger) { const tempScore = temporaryRiskScore(range, riskScore, mean, stdev) const offset = growthCurveIntersection(riskScore, tempScore, exp) const effectiveDays = daysElapsed + offset return calculateGrowthCurve(exp, effectiveDays, riskScore, logger) } // calculateNewRiskScore