weightOpt: Weight optimisation

Description Usage Arguments Details Value See Also Examples

View source: R/coin_rew8r.R

Description

This function provides optimised weights to agree with a pre-specified vector of "target importances".

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
weightOpt(
  COIN,
  itarg,
  aglev,
  cortype = "pearson",
  optype = "balance",
  toler = NULL,
  maxiter = NULL,
  out2 = NULL
)

Arguments

COIN

COIN object

itarg

a vector of (relative) target importances. For example, c(1,2,1) would specify that the second indicator should be twice as "important" as the other two.

aglev

The aggregation level to apply the weight adjustment to.

cortype

The type of correlation to use - can be either "pearson", "spearman" or "kendall". See stats::cor.

optype

The optimisation type. Either "balance", which aims to balance correlations according to a vector of "importances" specified by itarg (default), or "infomax" which aims to maximise overall correlations. This latter option is experimental and may not yet work very well.

toler

Tolerance for convergence. Defaults to 0.001 (decrease for more accuracy, increase if convergence problems).

maxiter

Maximum number of iterations. Default 500.

out2

Where to output the results. If "COIN" (default for COIN input), appends to updated COIN, creating a new list of weights in .$Parameters$Weights. Otherwise if "list" outputs to a list (default).

Details

This is a linear version of the weight optimisation proposed in this paper: doi: 10.1016/j.ecolind.2017.03.056. Weights are optimised to agree with a pre-specified vector of "importances". The optimised weights are returned back to the COIN.

See the chapter in the COINr online documentation for more details.

Value

If out2 = "COIN" returns an updated COIN object with a new set of weights in .$Parameters$Weights, plus details of the optimisation in .$Analysis. Else if out2 = "list" the same outputs (new weights plus details of optimisation) are wrapped in a list.

See Also

Examples

1
2
3
4
# build ASEM COIN up to aggregation
ASEM <- build_ASEM()
# optimise sub-pillar weights to give equal correlations with index
ASEM <- weightOpt(ASEM, itarg = "equal", aglev = 3, out2 = "COIN")

COINr documentation built on Nov. 30, 2021, 9:06 a.m.