effcop: Fit Vine copula models to matrices of effectiveness scores

Description Usage Arguments Value See Also Examples

Description

Fitting of and simulation from a copula model.

Usage

1
2
3
effcopFit(x, eff, ...)

reffcop(n, .effcop)

Arguments

x

a matrix or data frame of effectiveness scores to estimate dependence.

eff

a list of effectiveness distributions to use for the margins.

...

other parameters for vinecop, such as family_set, selcrit, trunc_lvl and cores.

n

number of observations to simulate.

.effcop

the effcop object representing the copula model (see effcopFit).

Value

effcopFit: an object of class effcop, with the following components:

data the matrix of effectiveness scores used to fit the copula.
pobs the matrix of pseudo-observations computed from data. This is stored because pseudo-observations are calculated breaking ties randomly (see pseudo_obs).
margins the list of marginal effectiveness distributions.
cop the underlying copulas fitted with vinecop.

These components may be altered to gain specific simulation capacity, such as systems with the same expected value.

reffcop: a matrix of random scores.

See Also

effCont and effDisc for available distributions for the margins. See package rvinecopulib for details on fitting the copulas.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Automatically build a gaussian copula to many systems
d <- web2010p20[,1:20] # sample P@20 data from 20 systems
effs <- effDiscFitAndSelect(d, support("p20")) # fit and select margins
cop <- effcopFit(d, effs, family_set = "gaussian") # fit copula
y <- reffcop(1000, cop) # simulate new 1000 topics

# compare observed vs. expected mean
E <- sapply(effs, function(e) e$mean)
E.hat <- colMeans(y)
plot(E, E.hat)
abline(0:1)

# compare observed vs. expected variance
Var <- sapply(effs, function(e) e$var)
Var.hat <- apply(y, 2, var)
plot(Var, Var.hat)
abline(0:1)

julian-urbano/simIReff documentation built on May 21, 2019, 9:37 a.m.