neutonsevero 2db98e95da feat(distributions): vectorize ricegamma logpdf, add K→0 fit fallback
- Replace per-term Python loop in _logpdf with a single vectorised kve
  call (shape N×M) in both ricegamma_gen and logricegamma_gen, giving
  order-of-magnitude speedup on large batch inputs.
- Add adaptive series truncation: n_terms ≈ 3K+30, collapses to n=1
  when K=0 so no unnecessary computation.
- Cache Gauss-Laguerre quadrature nodes in _cdf to avoid recomputing
  roots_genlaguerre on every optimiser call.
- Add fit() override that re-fits with K fixed to 0 when the MLE
  estimate falls below _K_ZERO_THRESH (1e-2), avoiding near-zero Rice
  series numerical issues.
- Register logricegamma in the generate_data.py fitting pipeline.
- Reduce ricegamma N_SERIES 90→36; adaptive truncation handles accuracy.
2026-05-27 16:58:03 -03:00
2026-04-10 15:01:07 -03:00
2026-04-08 22:53:33 -03:00
2026-04-16 11:52:44 -03:00
2026-04-16 11:52:44 -03:00

Clutter_chuva

Repositorio para códigos de fitting de distribuições de dados de chuva e clutter.

Gerenciamento de dependências

Este projeto usa uv para gerenciar dependências e ambientes virtuais.

Instalação do uv

curl -LsSf https://astral.sh/uv/install.sh | sh

Configurar o ambiente

# Cria o ambiente virtual e instala todas as dependências
uv sync

Adicionar dependências

# Adicionar um pacote ao projeto
uv add <pacote>

# Adicionar dependência de desenvolvimento
uv add --dev <pacote>

Executar scripts

# Executar um script dentro do ambiente virtual
uv run python scripts/meu_script.py

# Abrir o Jupyter
uv run jupyter notebook

As dependências do projeto estão declaradas em pyproject.toml e o lockfile uv.lock garante reprodutibilidade do ambiente.

Uso nos notebooks

from etc import Fitter
from scipy.stats import gamma, weibull_min, lognorm

fitter = Fitter(
    [gamma, weibull_min, lognorm],
    gamma_params={'floc': 0},
)
fitter.fit(data)
fitter.validate(n_mc_samples=999)
fitter.summary()
fitter.histogram_with_fits().show()

Estrutura

etc/                # pacote principal (importável nos notebooks)
  fitting/          # Fitter e DistributionSummary
  tools/            # funções de visualização (plots, CDF)
notebooks/          # notebooks Jupyter
scripts/            # scripts .py para execução em background
data/               # dados (não versionados)
Description
Repo com código para análise de dados RADAR
Readme 1,014 KiB
Languages
Jupyter Notebook 80.2%
Python 19.8%