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>
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
---
|
||||
name: generate_gbm_prices
|
||||
kind: function
|
||||
lang: py
|
||||
domain: finance
|
||||
version: "1.0.0"
|
||||
purity: pure
|
||||
signature: "generate_gbm_prices(initial_price: float, n_ticks: int, sigma: float, mu: float, jump_intensity: float, jump_size_std: float, seed: int) -> list[float]"
|
||||
description: "Genera serie de precios fundamentales con Geometric Brownian Motion + jump-diffusion. S(t+1) = S(t) * exp((mu - sigma^2/2)*dt + sigma*sqrt(dt)*Z + J*N)."
|
||||
tags: [simulation, gbm, price, montecarlo, finance, stochastic]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
returns_optional: false
|
||||
error_type: ""
|
||||
imports: [numpy]
|
||||
tested: false
|
||||
tests: []
|
||||
test_file_path: ""
|
||||
file_path: "python/functions/finance/finance.py"
|
||||
---
|
||||
|
||||
## Ejemplo
|
||||
|
||||
```python
|
||||
prices = generate_gbm_prices(
|
||||
initial_price=100.0,
|
||||
n_ticks=1000,
|
||||
sigma=0.02,
|
||||
mu=0.0,
|
||||
jump_intensity=0.01,
|
||||
jump_size_std=0.05,
|
||||
seed=42,
|
||||
)
|
||||
# prices[0] == 100.0
|
||||
# len(prices) == 1000
|
||||
```
|
||||
|
||||
## Notas
|
||||
|
||||
Funcion pura — el seed fija el resultado deterministicamente.
|
||||
`jump_intensity=0.0` desactiva los saltos (GBM puro).
|
||||
`dt=1.0` por tick (tiempo discreto). Para tiempo continuo, ajustar sigma y mu en consecuencia.
|
||||
Requiere numpy para la generacion de numeros aleatorios y el calculo de exp.
|
||||
Reference in New Issue
Block a user