Description Usage Arguments Value Examples
Finds the time index of the best analogue of block_conddim_BC
in conddim_REF
in terms of the Euclidean distance.
1 | find_bestanalogue_time(conddim_REF, block_conddim_BC)
|
conddim_REF |
A matrix of dimension |
block_conddim_BC |
A matrix of dimension |
A list with the following elements:
tstar The time index of the best analogue of block_conddim_BC
found in conddim_REF
.
This time index corresponds to the last time step of the block of rank association.
dist The euclidean distance between block_conddim_BC
and
the best analogue found in conddim_REF
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | refdata <- matrix(c(0.3, 0.5, 0.9, 0.8,
1.1, 1.7, 1.2, 1.9,
2.1, 1.8, 3.0, 2.7), ncol = 3, nrow = 4)
bc1d <- matrix(c(0.7, 0.5, 0.2, 0.9,
1.3, 1.8, 1.1, 1.4,
1.9, 2.9, 2.0, 2.6), ncol = 3, nrow = 4)
ranks_refdata <- apply(refdata, 2, rank)
ranks_bc1d <- apply(bc1d, 2, rank)
# 1 conditioning dimension, 0 lag
icond <- 1
block_conddim_BC <- ranks_bc1d[1, icond, drop = FALSE]
conddim_REF <- ranks_refdata[, icond, drop = FALSE]
find_bestanalogue_time(conddim_REF, block_conddim_BC)
# 1 conditioning dimension, 1 lag
icond <- 1
block_conddim_BC <- ranks_bc1d[1:2, icond, drop = FALSE]
conddim_REF <- ranks_refdata[, icond, drop = FALSE]
find_bestanalogue_time(conddim_REF, block_conddim_BC)
# 2 conditioning dimensions, 1 lag
icond <- 1:2
block_conddim_BC <- ranks_bc1d[1:2, icond, drop = FALSE]
conddim_REF <- ranks_refdata[, icond, drop = FALSE]
find_bestanalogue_time(conddim_REF, block_conddim_BC)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.