Skip to content

margEVT

0.4.0Package record

Regularized Point Processes and Stochastic Marginalization for Extremes

0packages depend
781downloads / year
100.0%test coverage
13/13flavors OK

Overview

About

Implements a non-stationary extreme value analysis framework by coupling a covariate-driven non-homogeneous Poisson process (NHPP) with (adaptive) elastic-net regularization and analytical gradients. Provides methods for estimating conditional return levels and unconditional (marginalized) return levels via parametric stochastic integration over stable vector autoregressive VAR(p) covariate trajectories, or non-parametric annual-block resampling. Supports block-specific penalty controls, BIC selection along a regularization path, Karush-Kuhn-Tucker convergence checks, time-rescaling residual diagnostics, conditional parametric bootstrap inference, and walk-forward assessment.

Changes in 0.4.0

Breaking changes

  • fit_nhpp(lambda_scaling = ) now defaults to "common" (one scalar penalty for all parameter blocks), the convention used in the dissertation and articles. Use lambda_scaling = "gradient" for the previous score-calibrated block penalties.
  • With lambda = "bic", the returned model is now the regularization-path solution at the selected penalty, so the reported fit is exactly the one scored by the BIC.
  • Convergence is now certified by the Karush-Kuhn-Tucker conditions of the penalized problem (grad_tol, scaled by the number of exceedances) rather than by the optimizer's return code. Fits that previously reported convergence may now warn, and vice versa.
Show all changes in 0.4.0Hide the rest of the changes in 0.4.0
  • summary() returns an object of class summary.nhpp_fit (printed as before) instead of printing directly.
  • The vars dependency was removed. VAR(p) generators are fitted by least squares with Schwarz order selection on a common sample, which reproduces vars::VARselect() and vars::VAR(); a single covariate is a VAR(p) with K = 1 rather than a separate AR model.
  • Random-number streams changed: bootstrap replicates use independent L'Ecuyer-CMRG streams and trajectories are simulated jointly, so results for a given seed differ from 0.3.0.

Estimation

  • Adaptive LASSO: penalty_weights = "adaptive" computes weights 1 / |theta|^adaptive_gamma from an unpenalized fit (ridge fallback); numeric coordinate weights are also accepted.
  • New fit_nhpp() arguments lambda_grid, init, and grad_tol. The optimizer falls back from BFGS to L-BFGS-B and a restarted BFGS when the KKT check fails.
  • Fitted objects store the penalty weights, the KKT violation, the evaluated regularization path (fit$path), and the observed series.
  • The likelihood, gradient, and penalty are evaluated once per parameter vector and shared between objective and gradient calls.

Methods and diagnostics

  • New methods logLik(), nobs(), predict(), residuals(), and coef() for nhpp_fit; AIC() and BIC() work through logLik().
  • residuals() returns time-rescaling interarrival residuals and magnitude residuals, both standard exponential under the model.
  • plot.nhpp_fit() gains type = "path" (BIC curve and coefficient paths) and type = "qq" (exponential Q-Q plots with exact pointwise bands).
  • n_exceedances() uses the stored series when y is omitted.

Marginalization and covariates

  • New seasonal_harmonics(); harmonics of any order (cos<k>, sin<k>, sen<k>) are recognized and rebuilt automatically.
  • marginalize() returns an nhpp_rl object with Monte Carlo standard errors of the return-level roots (se_mc), accepts fixed covariate values (e.g. list(trend = 1)), fills inactive design columns silently, and has a plot() method.
  • fit_var_generator() gains n_harmonics, excludes deterministic variables from the VAR, and supports derived covariates (lags, moving averages) through derive and derive_lead. simulate_covariates() simulates all trajectories at once and gains seed.

Bootstrap and walk-forward assessment

  • Bootstrap refits start from the original estimate and keep the original penalty weights, gradient tolerance, and scaling. Results do not depend on the new cores argument; replicate matrices are returned as the attribute "replicates".
  • backtest() gains trend_col (trend renormalized within each training window), fixed, reselect_lambda, and cores. Adaptive weights are recomputed inside each training window, and covariates inactive in a window refit are filled without warnings.

Documentation

  • New vignette, examples for every exported function, and an updated citation file.

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 4.6 min · r-oldrel-windows-x86_64
Status changes
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK7 OK2026-07-24
Advisories

none known

Documentation

In release 0.4.0
READMEYes · 923 wordsVignettesYes · 1 · dynamicNEWSYes · 100% structured · mentions 0.4.0Citation fileYes · cites a publicationWebsitenot declared in DESCRIPTION
Help pages
26
Examples that run
100%26 run in a plain check
Exported functions with examples
100%
Documented parameters
100%
Return-value docs
100%
Help pages citing references
4%

Downloads

781
CRAN downloads in the past year
Rank #17,299 · ~2/day · ~65/mo
Daily download trend is not available in this view yet.
30530 days
73790 days
7811 year
Compare downloads with other packages →
Also on31 r2u1 autocran

Repository

0Stars
0Forks
0Open issues
0Open PRs
2Releases
40Commits
1Commit identities
40 commits · Last activity 2026-10-13
Responsiveness
not measured

Releases over time

2026-07-31 · 02026-10-14 · 2
PracticesBeta

3 development-tooling and community-health practices detected across 2 families in the upstream repository

Checks run against github.com/rodrigosqrt3/margevt on 2026-10-22.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows

Coverage (1)
Coverage reporting
How this is detected·Detection ruleset v4 (2026-10-20)

Dependencies

Declared dependencies
4 external dependencies (excludes base and recommended)

Installing margEVT adds no packages beyond those that come with R.

Depends (0)
none
Imports (5)
graphicsgrDevicesparallelstatsutils
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

People & History

People (1)
Author, Maintainer since 0.1.0 (2026)
Listed in earlier versions (1)
Flavio Ziegelmann
no longer listed · 0.1.0 to 0.2.0
Releases (5)
Submitted 0.5.0, in pretest since 2026-10-23 19:40 UTC, as of the 2026-10-23 19:40 UTC queue snapshot. See the queue →

Pick two releases to compare their code metrics.

  • 0.4.0Latest
    record
    2026-10-13 · current release · diff ↗ ·
    added 1 export
    seasonal_harmonics
    ·
    listed once in CRAN's queue
    Seen in one reading of CRAN's incoming queue, at 2026-10-13 21:40 UTC, so it stayed less than the time between readings.
  • 0.3.0
    record
    2026-09-23 · diff ↗
  • 0.2.0
    record
    2026-07-30 · diff ↗
  • 0.1.1
    record
    2026-07-30 · diff ↗
  • 0.1.0
    record
    2026-07-23
  • R
    R 4.6.0 released · 2026-04-24
Across CRAN, the median accepted release of the past year spent 23 hours in the queue, 90% under 11 days.How queue time is measured

Package metadata

First published
2026-07-23
Total releases
5 / 1 yrs
License
GPL (>= 3) OSI
Download size
123 KB
Appears in task views

Cite

Cite this package

Run in R for the authors' entry:

citation("margEVT")

The package provides a citation file, so citation() returns the authors' own entry.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for margEVT version 0.4.0 [Data set]. HJJB, LLC. Data release v2026-10-23. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-23, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy