Estimators and Plots for Gamma and Pareto Tail Detection

Estimators for two functionals used to detect Gamma, Pareto or Lognormal distributions, as well as distributions exhibiting similar tail behavior, as introduced by Iwashita and Klar (2023) and Klar (2024) . One of these functionals, g, originally proposed by Asmussen and Lehtomaa (2017) , distinguishes between log-convex and log-concave tail behavior. Furthermore the characterization of the lognormal distribution is based on the work of Mosimann (1970) . The package also includes methods for visualizing these estimators and their associated confidence intervals across various threshold values.


Integration of C++ in Tailplots

Tailplots uses the R package Rcpp to integrate C++ code with R. One advantage of Rcpp is its extensive documentation, and many guides are available.

Structure of the Package

Under R/ you’ll find the package’s R code and two additional files, R/zzz.R and R/RcppExports.R. The first file sets the imports for the Tailplots package and can probably be removed now. The second contains the wrapper functions that connect the C++ code to R and shouldn’t be edited by hand (see the workflow below).

In the src/ folder you’ll find the C++ code. The only files that should be edited by hand are gamma.cpp and pareto.cpp; the other files are generated automatically by Rcpp. Any C++ function that you want to export and make available after devtools::load_all() must have the line // [[Rcpp::export]] immediately above the function definition. Include the following at the beginning of each C++ file:

#include <Rcpp.h>
using namespace Rcpp;

The rest is standard C++ code.

Note that the DESCRIPTION file contains:

Imports:
    Rcpp
LinkingTo:
    Rcpp

Workflow

The usual R package workflow described in R Packages (2e) R Packages workflow diagram is supplemented by the command Rcpp::compileAttributes(). To access newly written or modified C++ and R functions from the terminal, run:

Rcpp::compileAttributes()
devtools::load_all()

Everything else remains the same.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("tailplots")

0.1.1 by Bernhard Klar, a year ago


Browse source code at https://github.com/cran/tailplots


Authors: Bernhard Klar [aut, cre] , Lucas Iglesias [aut]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports Rcpp

Suggests actuar

Linking to Rcpp


See at CRAN