npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

quantitivecalc

v1.1.11

Published

A TypeScript library providing advanced quantitative finance functions for risk analysis, performance metrics, and technical indicators. (Currently in development)

Downloads

7

Readme

quantitivecalc

(Currently in development) A TypeScript library providing advanced quantitative finance functions for risk analysis, performance metrics, technical indicators, and portfolio analysis.

Features

  • Risk & Volatility Analysis
  • Technical Indicators
  • Performance Metrics
  • Portfolio Analysis
  • Data Processing Utilities

Available Functions

Performance Metrics

  • calculateAlpha - Computes excess returns relative to a benchmark.
  • calculateAnnualizedReturns - Calculates annualized return.
  • calculateCalmarRatio - Measures risk-adjusted returns.
  • calculateCompoundReturns - Calculates compound returns.
  • calculateDailyReturns - Computes daily returns.
  • calculateInformationRatio - Assesses risk-adjusted performance.
  • calculateSortinoRatio - Measures risk-adjusted returns considering downside risk.
  • calculatePeriodicCompoundReturns - Calculates compound returns over specified periods.
  • addPeriodicCompoundReturnsToData - Adds periodic compound returns to each row in the dataset.

List & Data Utilities

  • filterByRange - Filter list items based on a specified range.
  • findExtremesInColumn - Find min/max values in a column.
  • getFirstRow - Get the first row/item from a list.
  • getLastRow - Get the last row/item from a list.
  • setFirstItemToValue - Set a property on the first item in a list.
  • sortByColumn - Sort a list by a column.

Example: Sorting by column

import { qCalc } from 'quantitivecalc';

const data = [
  { name: 'Alice', score: 42 },
  { name: 'Bob', score: 75 },
  { name: 'Charlie', score: 60 }
];

const sorted = qCalc.listUtils.sortByColumn(data, 'score', true); // ascending order
console.log(sorted);
// Output: [ { name: 'Alice', score: 42 }, { name: 'Charlie', score: 60 }, { name: 'Bob', score: 75 } ]
  • analyzeColumnWithRange - Analyze a column and return statistics within a specified range.

Dict Of Lists Utilities

  • applyFunction - Apply a function to each value in a dictionary.
  • applyFunctionToFlattened - Apply a function to each item in flattened lists within a dictionary.
  • findExtremesInColumnPerKey - Find min/max values in a column for each key in a dictionary.
  • findExtremesInColumn - Find min/max values in a column across all keys.

Portfolio Analysis

  • calculateCorrelationMatrix - Computes correlation matrix for assets.
  • calculatePortfolioReturns - Calculates portfolio returns.
  • calculateRebalancing - Determines optimal rebalancing strategies.
  • calculateRiskContribution - Analyzes risk contribution of each asset.
  • Types: AssetReturn, CorrelationMatrix, PortfolioWeight, RebalancingResult, RiskContribution

Risk & Volatility Analysis

  • calculateBeta - Computes Beta coefficient.
  • calculateMaxDrawdown - Calculates maximum observed loss.
  • calculateSharpeRatio - Determines Sharpe Ratio.
  • calculateVaR - Estimates Value at Risk.
  • calculateVolatility - Measures statistical volatility.
  • getZScore - Calculates Z-Score.

Technical Indicators

  • calculateBollingerBands - Calculates Bollinger Bands.
  • calculateMACD - Calculates MACD indicator.
  • calculateMovingAverage - Calculates moving average.
  • calculateRSI - Calculates Relative Strength Index.
  • calculateStochasticOscillator - Calculates Stochastic Oscillator.

Installation

npm install quantitivecalc

License

ISC

Author

bitlogicforge