Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

pobs

Pseudo-Observations


Description

Compute the pseudo-observations for the given data matrix.

Usage

pobs(
  x,
  na.last = "keep",
  ties.method = eval(formals(rank)$ties.method),
  lower.tail = TRUE
)

Arguments

x

n x d-matrix of random variates to be converted to pseudo-observations.

na.last, ties.method

are passed to rank(); see there.

lower.tail

logical() which, if FALSE, returns the pseudo-observations when applying the empirical marginal survival functions.

Details

Given n realizations x_i=(x_{i1},...,x_{id}), i in {1,...,n} of a random vector X, the pseudo-observations are defined via u_{ij}=r_{ij}/(n+1) for i in {1,...,n} and j in {1,...,d}, where r_{ij} denotes the rank of x_{ij} among all x_{kj}, k in {1,...,n}. The pseudo-observations can thus also be computed by component-wise applying the empirical distribution functions to the data and scaling the result by n/(n+1). This asymptotically negligible scaling factor is used to force the variates to fall inside the open unit hypercube, for example, to avoid problems with density evaluation at the boundaries. Note that pobs(, lower.tail=FALSE) simply returns 1-pobs().

Value

matrix of the same dimensions as x containing the pseudo-observations.

Note

This function is borrowed from the copula() package.

Author(s)

Marius Hofert

Examples

## Simple definition of the function:
pobs

## simulate data from a multivariate normal distribution
library(mvtnorm)
set.seed(123)
Sigma <- matrix(c(2, 1, -0.2, 1, 1, 0.3, -0.2, 0.3, 0.5), 3, 3)
mu <- c(-3, 2, 1)
dat <- rmvnorm(500, sigma = Sigma)
pairs(dat)  # plot observations

## compute pseudo-observations for copula inference
udat <- pobs(dat)
pairs(udat)
# estimate vine copula model
fit <- RVineStructureSelect(udat, familyset = c(1, 2))

VineCopula

Statistical Inference of Vine Copulas

v2.4.1
GPL (>= 2)
Authors
Thomas Nagler [aut, cre], Ulf Schepsmeier [aut], Jakob Stoeber [aut], Eike Christian Brechmann [aut], Benedikt Graeler [aut], Tobias Erhardt [aut], Carlos Almeida [ctb], Aleksey Min [ctb, ths], Claudia Czado [ctb, ths], Mathias Hofmann [ctb], Matthias Killiches [ctb], Harry Joe [ctb], Thibault Vatter [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.