Files
fn_registry/python/functions/datascience/estimate_pareto_alpha.md
T
egutierrez cfdf515228 chore: auto-commit (799 archivos)
- .claude/CLAUDE.md
- .claude/commands/subagentes.md
- .claude/rules/INDEX.md
- .mcp.json
- bash/functions/cybersecurity/analyze_dns.md
- bash/functions/cybersecurity/audit_http_headers.md
- bash/functions/cybersecurity/audit_ssh_config.md
- bash/functions/cybersecurity/check_firewall.md
- bash/functions/cybersecurity/detect_suspicious_users.md
- bash/functions/cybersecurity/encrypt_file.md
- ...

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 00:28:20 +02:00

1.5 KiB
Raw Blame History

name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, params, output, tested, tests, test_file_path, file_path
name kind lang domain version purity signature description tags uses_functions uses_types returns returns_optional error_type imports params output tested tests test_file_path file_path
estimate_pareto_alpha function py datascience 1.0.0 pure def estimate_pareto_alpha(values: list[float], x_min_percentile: float = 90.0) -> dict Estima el exponente alpha de una distribución Pareto via MLE. Alpha bajo indica cola más pesada y mayor frecuencia de valores extremos.
estimation
pareto
power-law
heavy-tail
statistics
pendiente-usar
false
numpy
name desc
values lista de valores numericos positivos donde se sospecha cola pesada (ej: tamanios de ordenes, ingresos). Debe haber >10 valores.
name desc
x_min_percentile percentil a partir del cual considerar la cola (tipico: 90.0 para considerar el 10% superior)
dict con {alpha, x_min, n_tail} donde alpha es el exponente estimado (menor = cola mas pesada) false
python/functions/datascience/datascience.py

Ejemplo

import numpy as np
# Simular datos con cola pesada
values = list(np.random.pareto(2.0, 1000) + 1)
result = estimate_pareto_alpha(values, x_min_percentile=90.0)
# {'alpha': ~2.0, 'x_min': ..., 'n_tail': 100}

Notas

Usa el estimador MLE de Hill: α = n / Σ ln(xᵢ / x_min). x_min se determina como el percentil indicado de los valores positivos. Retorna alpha=0 si hay menos de 10 valores positivos o la cola tiene menos de 2 elementos. Función pura: requiere numpy instalado.