Package libstabler. June 1, 2017

Similar documents
Package coga. May 8, 2018

Package alphastable. June 15, 2018

Package robustreg. R topics documented: April 27, Version Date Title Robust Regression Functions

Package GUTS. R topics documented: October 10, Type Package

Package cattonum. R topics documented: May 2, Type Package Version Title Encode Categorical Features

Package ADMM. May 29, 2018

Package bayesdp. July 10, 2018

Package validara. October 19, 2017

Journal of Statistical Software

Package wrswor. R topics documented: February 2, Type Package

Package semver. January 6, 2017

Package datasets.load

Package bisect. April 16, 2018

Package TVsMiss. April 5, 2018

Package ECctmc. May 1, 2018

Package geogrid. August 19, 2018

Package CompGLM. April 29, 2018

Package SimilaR. June 21, 2018

Package ParetoPosStable

Package robets. March 6, Type Package

Package SSLASSO. August 28, 2018

Package SEMrushR. November 3, 2018

Package hyphenatr. August 29, 2016

Package geojsonsf. R topics documented: January 11, Type Package Title GeoJSON to Simple Feature Converter Version 1.3.

Package BayesCR. September 11, 2017

Package optimization

Package pwrab. R topics documented: June 6, Type Package Title Power Analysis for AB Testing Version 0.1.0

Package MIICD. May 27, 2017

Package quadprogxt. February 4, 2018

Package ihs. February 25, 2015

Package d3plus. September 25, 2017

Package subplex. April 5, 2018

Package bigreadr. R topics documented: August 13, Version Date Title Read Large Text Files

Package Numero. November 24, 2018

Package intccr. September 12, 2017

Package inca. February 13, 2018

Package kirby21.base

Package stapler. November 27, 2017

Package MCMC4Extremes

Package intcensroc. May 2, 2018

Package gridgraphics

Package acebayes. R topics documented: November 21, Type Package

Package RNAseqNet. May 16, 2017

Package ecoseries. R topics documented: September 27, 2017

Package ibm. August 29, 2016

Package ccapp. March 7, 2016

Package farver. November 20, 2018

Package strat. November 23, 2016

Package elmnnrcpp. July 21, 2018

Package Rspc. July 30, 2018

Package GenSA. R topics documented: January 17, Type Package Title Generalized Simulated Annealing Version 1.1.

Package rmi. R topics documented: August 2, Title Mutual Information Estimators Version Author Isaac Michaud [cre, aut]

Package tm.plugin.lexisnexis

Package sure. September 19, 2017

Package gtrendsr. October 19, 2017

Package rvinecopulib

Package Rsomoclu. January 3, 2019

Package splitfeas. April 11, 2018

Package readobj. November 2, 2017

Package RaPKod. February 5, 2018

Package survivalmpl. December 11, 2017

Package kdevine. May 19, 2017

Package bife. May 7, 2017

Package coxsei. February 24, 2015

Package kdtools. April 26, 2018

Package CLA. February 6, 2018

Package ramcmc. May 29, 2018

Package FCGR. October 13, 2015

Package IATScore. January 10, 2018

Package sspse. August 26, 2018

Package Kernelheaping

Package lhs. R topics documented: January 4, 2018

Package Bergm. R topics documented: September 25, Type Package

Package weco. May 4, 2018

Package fitur. March 11, 2018

Package fastdummies. January 8, 2018

Package mmtsne. July 28, 2017

Package GUILDS. September 26, 2016

Package vinereg. August 10, 2018

Package AhoCorasickTrie

Package DPBBM. September 29, 2016

Package exporkit. R topics documented: May 5, Type Package Title Expokit in R Version Date

Package ercv. July 17, 2017

Package NORTARA. February 19, 2015

Package StVAR. February 11, 2017

Package rpst. June 6, 2017

Package messaging. May 27, 2018

Package glogis. R topics documented: March 16, Version Date

Package manet. September 19, 2017

Package lvm4net. R topics documented: August 29, Title Latent Variable Models for Networks

Package simsurv. May 18, 2018

Package milr. June 8, 2017

Package effectr. January 17, 2018

Package meshsimp. June 13, 2017

Package sglr. February 20, 2015

Package lcc. November 16, 2018

Package rucrdtw. October 13, 2017

Package mrm. December 27, 2016

Package HDInterval. June 9, 2018

Package KRMM. R topics documented: June 3, Type Package Title Kernel Ridge Mixed Model Version 1.0 Author Laval Jacquin [aut, cre]

Transcription:

Version 1.0 Date 2017-05-25 Package libstabler June 1, 2017 Title Fast and Accurate Evaluation, Random Number Generation and Parameter Estimation of Skew Stable Distributions Tools for fast and accurate evaluation of skew stable distributions (CDF, PDF and quantile functions), random number generation and parameter estimation. License GPL-3 Imports Rcpp (>= 0.12.9) LinkingTo Rcpp Encoding UTF-8 NeedsCompilation yes Author Javier Royuela del Val [aut, cre], Federico Simmross-Wattenberg [aut], Carlos Alberola López [aut] Maintainer Javier Royuela del Val <jroyval@lpi.tel.uva.es> Repository CRAN Date/Publication 2017-06-01 10:59:15 UTC R topics documented: libstabler-package..................................... 2 stable_fit........................................... 3 stable_pdf_and_cdf..................................... 5 stable_q........................................... 6 stable_rnd.......................................... 7 Index 9 1

2 libstabler-package libstabler-package LibstableR: Fast and accurate evaluation, random number generation and parameter estimation of skew stable distributions. LibstableR provides functions to work with skew stable distributions in a fast and accurate way [1]. It performs: - Fast and accurate evaluation of the probability density function (PDF) and cumulative density function (CDF). - Fast and accurate evaluation of the quantile function (CDF^-1). - Random numbers generation [2]. - Skew stable parameter estimation with: McCulloch s method of quantiles [3]. Koutrouvellis method based on the characteristic function [4]. Maximum likelihood estimation. Modified maximum likelihood estimation as described in [1]. - The evaluation of the PDF and CDF is based on the formulas provided by John P Nolan in [5]. References [1] Royuela-del-Val J, Simmross-Wattenberg F, Alberola López C (2017). libstable: Fast, Parallel and High-Precision Computation of alpha-stable Distributions in R, C/C++ and MATLAB. Journal of Statistical Software, 78(1), 1-25. doi:10.18637/jss.v078.i01 [2] Chambers JM, Mallows CL, Stuck BW (1976). A Method for Simulating Stable Random Variables. Journal of the American Statistical Association, 71(354), 340-344. doi:10.1080/01621459.1976.10480344 [3] McCulloch JH (1986). Simple Consistent Estimators of Stable Distribution Parameters. Communications in Statistics - Simulation and Computation, 15(4), 1109-1136. doi:10.1080/03610918608812563 [4] Koutrouvelis IA (1981). An Iterative Procedure for the Estimation of the Parameters of Stable Laws. Communications in Statistics - Simulation and Computation, 10(1), 17-28. doi:10.1080/03610918108812189 [5] Nolan JP (1997). Numerical Calculation of Stable Densities and Distribution Functions. Stochastic Models, 13(4), 759-774. doi:10.1080/15326349708807450

stable_fit 3 Examples # Set alpha, beta, sigma and mu stable parameters in a vector pars <- c(1.5, 0.9, 1, 0) # Generate an abscissas axis and probabilities vector x <- seq(-5, 10, 0.05) p <- seq(0.01, 0.99, 0.01) # Calculate pdf, cdf and quantiles pdf <- stable_pdf(x, pars) cdf <- stable_cdf(x, pars) xq <- stable_q(p, pars) # Generate 300 random values rnd <- stable_rnd(300, pars) # Estimate the parameters of the skew stable distribution given # the generated sample: # Using the McCulloch's estimator: pars_est_m <- stable_fit_init(rnd) # Using the Koutrouvelis' estimator: pars_est_k <- stable_fit_koutrouvelis(rnd, pars_est_m) # Using maximum likelihood estimator, with McCulloch estimation # as a starting point: # pars_est_ml <- stable_fit_mle(rnd, pars_est_m) # Using modified maximum likelihood estimator (See [1]): # pars_est_ml2 <- stable_fit_mle2d(rnd, pars_est_m) stable_fit stable_fit: Methods for parameter estimation of skew stable distributions. Usage A set of functions are provided that perform the parameter estimation of skew stable distributions with different methods. stable_fit_init(rnd, parametrization = 0) stable_fit_koutrouvelis(rnd, pars_init, parametrization = 0)

4 stable_fit Arguments rnd Details Value stable_fit_mle(rnd, pars_init, parametrization = 0) stable_fit_mle2d(rnd, pars_init, parametrization = 0) Random sample pars_init Vector with an initial estimation of the parameters. pars_init = c(alpha, beta, sigma, mu), where - alpha: shape / stability parameter, with 0 < alpha <= 2. - beta: skewness parameter, with -1 <= beta <= 1. - sigma: scale parameter, with 0 < sigma. - mu: location parameter, with mu real. parametrization Parametrization used for the skew stable distribution, as defined by JP Nolan (1997). By default, parametrization = 0. stable_fit_init() uses McCulloch s method of quantiles [3]. This is usually a good initialization for the rest of the methods. stable_fit_koutrouvelis() implements Koutrouvellis method based on the characteristic function [4]. stable_fit_mle() implements a Maximum likelihood estimation. stable_fit_mle2() implements a modified maximum likelihood estimation as described in [1]. A numeric vector. References [1] Royuela-del-Val J, Simmross-Wattenberg F, Alberola López C (2017). libstable: Fast, Parallel and High-Precision Computation of alpha-stable Distributions in R, C/C++ and MATLAB. Journal of Statistical Software, 78(1), 1-25. doi:10.18637/jss.v078.i01 [2] Chambers JM, Mallows CL, Stuck BW (1976). A Method for Simulating Stable Random Variables. Journal of the American Statistical Association, 71(354), 340-344. doi:10.1080/01621459.1976.10480344. [3] McCulloch JH (1986). Simple Consistent Estimators of Stable Distribution Parameters. Communications in Statistics - Simulation and Computation, 15(4), 1109-1136. doi:10.1080/03610918608812563. [4] Koutrouvelis IA (1981). An Iterative Procedure for the Estimation of the Parameters of Stable Laws. Communications in Statistics - Simulation and Computation, 10(1), 17-28. doi:10.1080/03610918108812189.

stable_pdf_and_cdf 5 [5] Nolan JP (1997). Numerical Calculation of Stable Densities and Distribution Functions. Stochastic Models, 13(4) 759-774. doi:10.1080/15326349708807450. Examples # Set alpha, beta, sigma and mu stable parameters in a vector pars <- c(1.5, 0.9, 1, 0) # Generate 300 random values rnd <- stable_rnd(300, pars) # Estimate the parameters of the skew stable distribution given # the generated sample: # Using the McCulloch's estimator: pars_init <- stable_fit_init(rnd) # Using the Koutrouvelis' estimator, with McCulloch estimation # as a starting point: pars_est_k <- stable_fit_koutrouvelis(rnd, pars_init) # Using maximum likelihood estimator: # pars_est_ml <- stable_fit_mle(rnd, pars_est_k) # Using modified maximum likelihood estimator (see [1]): # pars_est_ml2 <- stable_fit_mle2d(rnd, pars_est_k) stable_pdf_and_cdf stable_pdf/stable_cdf: PDF and CDF of a skew stable distribution. Evaluate the PDF or the CDF of the skew stable distribution with parameters pars = c(alpha, beta, sigma, mu) at the points given in x. _parametrization_ argument specifies the parametrization used for the distribution as described by JP Nolan (1997). The default value is _parametrization_ = 0. _tol_ sets the relative error tolerance (precision) to _tol_. The default value is tol = 1e-12. Usage stable_pdf(x, pars, parametrization = 0, tol = 1e-12) stable_cdf(x, pars, parametrization = 0, tol = 1e-12) Arguments x Vector of points where the pdf will be evaluated.

6 stable_q Value pars Vector of skew stable distribution parameters pars = c(alpha, beta, sigma, mu), where - alpha: shape / stability parameter, with 0 < alpha <= 2. - beta: skewness parameter, with -1 <= beta <= 1. - sigma: scale parameter, with 0 < sigma. - mu: location parameter, with mu real. parametrization Parametrization used for the skew stable distribution, as defined by JP Nolan (1997). By default, parametrization = 0. tol Relative error tolerance (precision) of the calculated values. By default, tol = 1e-12. A numeric vector. References Nolan JP (1997). Numerical Calculation of Stable Densities and Distribution Functions. Stochastic Models, 13(4) 759-774. Examples pars <- c(1.5, 0.9, 1, 0) x <- seq(-5, 10, 0.001) pdf <- stable_pdf(x, pars) cdf <- stable_cdf(x, pars) plot(x, pdf, type = "l") stable_q stable_q: quantile function of skew stable distributions Evaluate the quantile function (CDF^-1) of the skew stable distribution with parameters pars = c(alpha, beta, sigma, mu) at the points given in p. _parametrization_ argument specifies the parametrization used for the distribution as described by JP Nolan (1997). The default value is _parametrization_ = 0. _tol_ sets the relative error tolerance (precission) to _tol_. The default value is tol = 1e-12.

stable_rnd 7 Usage stable_q(p, pars, parametrization = 0, tol = 1e-12) Arguments p Vector of points where the quantile function will be evaluated, with 0 < p[i] < 1.0 pars Vector of skew stable distribution parameters pars = c(alpha, beta, sigma, mu), where - alpha: shape / stability parameter, with 0 < alpha <= 2. - beta: skewness parameter, with -1 <= beta <= 1. - sigma: scale parameter, with 0 < sigma. - mu: location parameter, with mu real. parametrization Parametrization used for the skew stable distribution, as defined by JP Nolan (1997). By default, parametrization = 0. tol Relative error tolerance (precission) of the calculated values. By default, tol = 1e-12. Value A numeric vector. stable_rnd stable_rnd: Skew stable distribution random sample generation. stable_rnd(n, pars) generates N random samples of a skew stable distribuiton with parameters pars = c(alpha, beta, sigma, mu) using the Chambers, Mallows, and Stuck (1976) method. The random number generator seed is set to the _seed_ argument before execution. If _seed_ = 0, the system time is used. Usage stable_rnd(n, pars, parametrization = 0, seed = 0)

8 stable_rnd Arguments N Value Number of values to generate. pars Vector of skew stable distribution parameters pars = c(alpha, beta, sigma, mu), where - alpha: shape / stability parameter, with 0 < alpha <= 2. - beta: skewness parameter, with -1 <= beta <= 1. - sigma: scale parameter, with 0 < sigma. - mu: location parameter, with mu real. parametrization Parametrization used for the skew stable distribution, as defined by JP Nolan (1997). By default, parametrization = 0. seed A numeric vector. Seed used to initialize the internal random numbers generators. If not provided, it is set by default to the system time. By default, seed = 0. References Chambers JM, Mallows CL, Stuck BW (1976). A Method for Simulating Stable Random Variables. Journal of the American Statistical Association, 71(354), 340-344. doi:10.1080/01621459.1976.10480344. Examples N <- 1000 pars <- c(1.25, 0.95, 1.0, 0.0) rnd <- stable_rnd(n, pars) hist(rnd)

Index Topic distribution stable_fit, 3 stable_pdf_and_cdf, 5 stable_q, 6 stable_rnd, 7 Topic package libstabler-package, 2 libstabler (libstabler-package), 2 libstabler-package, 2 libstabler_stable_cdf (stable_pdf_and_cdf), 5 libstabler_stable_fit_init (stable_fit), 3 libstabler_stable_fit_koutrouvelis (stable_fit), 3 libstabler_stable_fit_mle (stable_fit), 3 libstabler_stable_fit_mle2d (stable_fit), 3 libstabler_stable_pdf (stable_pdf_and_cdf), 5 libstabler_stable_q (stable_q), 6 libstabler_stable_rnd (stable_rnd), 7 stable_cdf (stable_pdf_and_cdf), 5 stable_fit, 3 stable_fit_init (stable_fit), 3 stable_fit_koutrouvelis (stable_fit), 3 stable_fit_mle (stable_fit), 3 stable_fit_mle2d (stable_fit), 3 stable_pdf (stable_pdf_and_cdf), 5 stable_pdf_and_cdf, 5 stable_q, 6 stable_rnd, 7 9