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

@visactor/vutils

v1.0.28

Published

util

Readme

标准正态逆 CDF

import { normalQuantile } from '@visactor/vutils';
normalQuantile(0.975); // 约 1.95996398454

normalQuantile(p) 复用回归区间原有的 Acklam 近似。p 在 (0,1) 返回有限分位数,0 / 1 返回 −Infinity / Infinity,非法概率或非有限输入返回 NaN。SciPy 1.13.1 基准检查尾部 1e-12 至 1−1e-12 和分段边界,绝对误差小于 5e-8。回归区间也调用此工具,避免维护重复实现。

回归区间的 alpha 表示显著性水平,置信度为 1-alpha,默认 alpha=0.05。区间通过下尾概率计算临界值,避免 1-alpha/2 在 alpha 极小时舍入为 1。

alpha=0 时,正标准误产生无限区间,零标准误产生退化区间;alpha=1 产生退化区间。非有限 alpha 或超出 [0,1] 的值产生 NaN 区间端点。

LOWESS 回归

regressionLowess 保留历史默认参数 span=0.3、iterations=2;仅省略的参数使用默认值,显式 iterations=0 仍表示不做稳健重加权。默认使用全部有效观测;数值稳定性、最近邻选择以及同一模型下 predict、evaluateGrid、fitted 和置信区间均值一致性的修复继续保留。

需要对齐 statsmodels 默认参数的调用方,应显式指定 span=2/3、iterations=3。StatPlots 已显式传入这些参数,不依赖 VUtils 的默认选择。

import { regressionLowess } from '@visactor/vutils';

const data = [0, 1, 2, 3, 4].map(x => ({ x, y: x + Math.sin(x) }));
const model = regressionLowess(data); // span=0.3、iterations=2
const statsmodelsModel = regressionLowess(data, undefined, undefined, {
  span: 2 / 3,
  iterations: 3
});