Learn R Programming

mev (version 1.17)

spunif: Semi-parametric marginal transformation to uniform

Description

The function spunif transforms a matrix or vector of data x to the pseudo-uniform scale using a semiparametric transform. Data below the threshold are transformed to pseudo-uniforms using a rank transform, while data above the threshold are assumed to follow a generalized Pareto distribution. The parameters of the latter are estimated using maximum likelihood if either scale = NULL or shape = NULL.

Usage

spunif(x, thresh, scale = NULL, shape = NULL)

Value

a matrix or vector of the same dimension as x, with pseudo-uniform observations

Arguments

x

matrix or vector of data

thresh

vector of marginal thresholds

scale

vector of marginal scale parameters for the generalized Pareto

shape

vector of marginal shape parameters for the generalized Pareto

Author

Leo Belzile

Examples

Run this code
x <- rmev(1000, d = 3, param = 2, model = 'log')
thresh <- apply(x, 2, quantile, 0.95)
spunif(x, thresh)

Run the code above in your browser using DataLab