Take a vector fobs
of assembly performances
over several experiments
and return a vector of performances
predicted as the mean performances of assemblages
that share the same assembly motif.
Assembly motifs are labelled in the vector assMotif
.
Experiments are labelled in the vector xpr
.
Modelling options are indicated in opt.mean
and opt.model
.
Occurrence matrix mOccur
is used if opt.model = "byelt"
.
Cross-validation is leave-one-out or jackknifesi
validate_using_cross_validation(fobs, assMotif, mOccur, xpr,
opt.mean = "amean", opt.model = "bymot",
opt.jack = FALSE, jack = c(3,4) )
a numeric vector. The vector fobs
contains the
quantitative performances of assemblages.
a vector of labels of length(fobs)
.
The vector assMotif
contains the assembly motifs of assemblages.
a matrix of occurrence (occurrence of elements).
Its first dimension equals to length(fobs)
. Its second dimension
equals to the number of elements.
a vector of numerics of length(fobs)
.
The vector xpr
contains the weight of each experiment,
and the labels (in names(xpr)
) of different experiments.
The weigth of each experiment is used
in the computation of the Residual Sum of Squares
in the function rss_clustering
.
The used formula is rss
if each experiment has the same weight.
The used formula is wrss
(barycenter of RSS for each experiment)
if each experiment has different weights.
All assemblages that belong to a given experiment
should then have a same weigth.
Each experiment is identified by its names (names(xpr)
)
and the RSS of each experiment is weighted by values of xpr
.
The vector is generated
by the function
stats::setNames
.
switchs to arithmetic formula opt.mean = "amean"
or geometric formula opt.mean = "gmean"
.
switchs to model type:
simple mean by assembly motif opt.model = "bymot"
or linear model with assembly motif opt.model = "byelt"
.
a logical, that switchs towards cross-validation method.
If opt.jack = FALSE
, a "leave-one-out" is used:
predicted performances are computed
as the mean of performances of assemblages
that share a same assembly motif,
experiment by experiment,
except the only assemblage to predict.
If opt.jack = TRUE
, a jackknife method is used:
the set of assemblages belonging to a same assembly motif is divided
into jack[2]
subsets of jack[1]
assemblages.
Predicted performances are computed,
experiment by experiment,
by excluding jack[1]
assemblages,
including the assemblage to predict.
If the total number of assemblages belonging
to the assembly motif is lower than jack[1]*jack[2]
,
predictions are computed by Leave-One-Out method.
an integer vector of length 2
.
The vector specifies the parameters for jackknife method.
The first integer jack[1]
specifies the size of subset,
the second integer jack[2]
specifies the number of subsets.
Return a vector of length(fobs)
.
Its values are predicted
according to opt.mean
and opt.model
.
None.