Files
fn_registry/python/functions/datascience/estimate_pareto_alpha.md
T
egutierrez 63a9cb5273 feat: funciones Python datascience, finance, cybersecurity y pipelines
Datascience: aggregate_by_group, deduplicate_entities/relations, detect_drift,
diff_entities/relations, extract_entities/relations_llm, hotness_score, melt,
merge_graphs, pivot, build_entity/relation_schema_prompt.
Finance: avellaneda_stoikov_quotes, generate_gbm_prices, generate_taker_order,
hawkes_intensity + módulo finance.py.
Cybersecurity: envelope_encrypt/decrypt + módulo cybersecurity.py.
Pipelines: extraction_pipeline, monte_carlo_market, run_market_sim.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 17:11:32 +02:00

1.1 KiB
Raw Blame History

name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, 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 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
false
numpy
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.