Skip to contents

fit_pair_copula() is the maximum likelihood fit of one family in one rotation to observations (u, v) in (0, 1) (take pseudo_obs() of raw data first), within pyvinecopulib's parameter bounds; the Student t by its profile likelihood over nu in [2, 50]. select_pair_copula() picks the best by AIC or BIC over families (each of Clayton, Gumbel and Joe in the two rotations that match the sign of Kendall's tau) and independence, as pyvinecopulib's Bicop.select does; with independence_test a level, a pair whose Kendall test p-value is above it is independence. kendall_tau() is Kendall's tau-b and pseudo_obs() each value's average rank over n + 1.

Usage

fit_pair_copula(u, v, family, rotation = 0)

select_pair_copula(
  u,
  v,
  families = NULL,
  criterion = c("aic", "bic"),
  independence_test = NULL
)

kendall_tau(x, y)

pseudo_obs(x)

Arguments

u, v

Observations in (0, 1).

family

A family, as for pair_copula().

rotation

0, 90, 180 or 270.

families

Families to try; NULL for the Gaussian, Student, Clayton, Gumbel, Frank and Joe.

criterion

"aic" or "bic".

independence_test

A level for the independence test, or NULL.

x, y

Samples.

Value

fit_pair_copula() and select_pair_copula(): a list with pair (a pair_copula()), log_likelihood, n_parameters, aic and bic; kendall_tau() a number; pseudo_obs() a vector.

Examples

set.seed(1)
x <- rnorm(500)
y <- x + rnorm(500)
u <- pseudo_obs(x)
v <- pseudo_obs(y)
kendall_tau(x, y)
#> [1] 0.4716633
select_pair_copula(u, v)$pair
#> [[1]]
#> [1] "gaussian"
#> 
#> [[2]]
#> [1] 0.6787112
#> 
#> [[3]]
#> [1] 0
#> 
#> [[4]]
#> [1] NaN
#>