47fac22230
- .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>
1.5 KiB
1.5 KiB
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. |
|
false |
|
|
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.