| Title: | Query Composite Hypotheses |
|---|---|
| Description: | Provides functions for the joint analysis of Q sets of p-values obtained for the same list of items. This joint analysis is performed by querying a composite hypothesis, i.e. an arbitrary complex combination of simple hypotheses, as described in Mary-Huard et al. (2021) <doi:10.1093/bioinformatics/btab592> and De Walsche et al.(2025) <doi: 10.1093/nargab/lqaf118>. In this approach, the Q-uplet of p-values associated with each item is distributed as a multivariate mixture, where each of the 2^Q components corresponds to a specific combination of simple hypotheses. The dependence between the p-value series is considered using a Gaussian copula function. A p-value for the composite hypothesis test is derived from the posterior probabilities. |
| Authors: | Tristan Mary-Huard [aut, cre] (ORCID: <https://orcid.org/0000-0002-3839-9067>), Annaig De Walsche [aut] (ORCID: <https://orcid.org/0000-0003-0603-1716>), Franck Gauthier [ctb] (ORCID: <https://orcid.org/0000-0003-0574-065X>) |
| Maintainer: | Tristan Mary-Huard <[email protected]> |
| License: | GPL-3 |
| Version: | 2.1.3 |
| Built: | 2026-05-27 18:57:05 UTC |
| Source: | https://github.com/cran/qch |
Gaussian copula density for each H-configuration.
Copula.Hconfig_gaussian_density(Hconfig, F0Mat, F1Mat, R)Copula.Hconfig_gaussian_density(Hconfig, F0Mat, F1Mat, R)
Hconfig |
A list of all possible combination of |
F0Mat |
a matrix containing the evaluation of the marginal cdf under |
F1Mat |
a matrix containing the evaluation of the marginal cdf under |
R |
the correlation matrix. |
A matrix containing the evaluation of the Gaussian density function for each H-configuration in columns.
EM calibration in the case of the Gaussian copula (unsigned)
EM_calibration_gaussian( Hconfig, F0Mat, F1Mat, fHconfig, R.init, Prior.init, Precision = 1e-06, max_iter = 10000 )EM_calibration_gaussian( Hconfig, F0Mat, F1Mat, fHconfig, R.init, Prior.init, Precision = 1e-06, max_iter = 10000 )
Hconfig |
A list of all possible combination of |
F0Mat |
a matrix containing the evaluation of the marginal cdf under |
F1Mat |
a matrix containing the evaluation of the marginal cdf under |
fHconfig |
a matrix containing H-config densities evaluated at each items, each column corresponding to a configurations. |
R.init |
the initialization of the correlation matrix of the Gaussian copula parameter. |
Prior.init |
the initialization of prior probabilities for each of the H-configurations. |
Precision |
Precision for the stop criterion. (Default is 1e-6) |
max_iter |
the maximum number of iterations allowed for the algorithm to converge or complete its process.(Default is 1e4.) |
A list with the following elements:
priorHconfig |
vector of estimated prior probabilities for each of the H-configurations. |
Rcopula |
the estimated correlation matrix of the Gaussian copula. |
EM calibration in the case of the Gaussian copula (unsigned) with memory management
EM_calibration_gaussian_memory( Logf0Mat, Logf1Mat, F0Mat, F1Mat, Prior.init, R.init, Hconfig, Precision = 1e-06, threads_nb, max_iter = 10000 )EM_calibration_gaussian_memory( Logf0Mat, Logf1Mat, F0Mat, F1Mat, Prior.init, R.init, Hconfig, Precision = 1e-06, threads_nb, max_iter = 10000 )
Logf0Mat |
a matrix containing the |
Logf1Mat |
a matrix containing the |
F0Mat |
a matrix containing the evaluation of the marginal cdf under |
F1Mat |
a matrix containing the evaluation of the marginal cdf under |
Prior.init |
the initialization of prior probabilities for each of the H-configurations. |
R.init |
the initialization of the correlation matrix of the gaussian copula parameter. |
Hconfig |
A list of all possible combination of |
Precision |
Precision for the stop criterion. (Default is 1e-6) |
threads_nb |
The number of threads to use. |
max_iter |
the maximum number of iterations allowed for the algorithm to converge or complete its process.(Default is 1e4.) |
A list with the following elements:
priorHconfig |
vector of estimated prior probabilities for each of the H-configurations. |
Rcopula |
the estimated correlation matrix of the Gaussian copula. |
EM calibration in the case of conditional independence
EM_calibration_indep(fHconfig, Prior.init, Precision = 1e-06, max_iter = 10000)EM_calibration_indep(fHconfig, Prior.init, Precision = 1e-06, max_iter = 10000)
fHconfig |
a matrix containing config densities evaluated at each items, each column corresponding to a configurations. |
Prior.init |
the initialization of prior probabilities for each of the H-configurations. |
Precision |
Precision for the stop criterion. (Default is 1e-6) |
max_iter |
the maximum number of iterations allowed for the algorithm to converge or complete its process.(Default is 1e4.) |
a vector of estimated prior probabilities for each of the H-configurations.
EM calibration in the case of conditional independence with memory management (unsigned)
EM_calibration_indep_memory( Logf0Mat, Logf1Mat, Prior.init, Hconfig, Precision = 1e-06, threads_nb, max_iter = 10000 )EM_calibration_indep_memory( Logf0Mat, Logf1Mat, Prior.init, Hconfig, Precision = 1e-06, threads_nb, max_iter = 10000 )
Logf0Mat |
a matrix containing the |
Logf1Mat |
a matrix containing the |
Prior.init |
the initialization of prior probabilities for each of the H-configurations. |
Hconfig |
A list of all possible combination of |
Precision |
Precision for the stop criterion. (Default is 1e-6) |
threads_nb |
The number of threads to use. |
max_iter |
the maximum number of iterations allowed for the algorithm to converge or complete its process.(Default is 1e4.) |
a vector of estimated prior probabilities for each of the H-configurations.
Signed case function: Separate f1 into f+ and f-
f1_separation_signed(XMat, f0Mat, f1Mat, p0, plotting = FALSE)f1_separation_signed(XMat, f0Mat, f1Mat, p0, plotting = FALSE)
XMat |
a matrix of probit-transformed p-values, each column corresponding to a p-value serie. |
f0Mat |
a matrix containing the evaluation of the marginal density functions under |
f1Mat |
a matrix containing the evaluation of the marginal density functions under |
p0 |
the proportions of |
plotting |
boolean, should some diagnostic graphs be plotted. (Default is FALSE.) |
A list with the following elements:
f1plusMat |
a matrix containing the evaluation of the marginal density functions under
at each items, each column corresponding to a p-value serie. |
f1minusMat |
a matrix containing the evaluation of the marginal density functions under
at each items, each column corresponding to a p-value serie. |
p1plus |
an estimate of the proportions of items for each series. |
p1minus |
an estimate of the proportions of items for each series.
|
Kernel estimation of the density in a two-components mixture model where one component are a standard Gaussian density.
FastKerFdr_signed( X, p0 = NULL, plotting = FALSE, NbKnot = 1e+05, tol = 1e-05, max_iter = 10000 )FastKerFdr_signed( X, p0 = NULL, plotting = FALSE, NbKnot = 1e+05, tol = 1e-05, max_iter = 10000 )
X |
a vector of probit-transformed p-values (corresponding to a p-value serie). |
p0 |
a priori proportion of |
plotting |
boolean, should some diagnostic graphs be plotted. (Default is FALSE.) |
NbKnot |
The (maximum) number of knot for the |
tol |
a tolerance value for convergence. (Default is 1e-5.) |
max_iter |
the maximum number of iterations allowed for the algorithm to converge or complete its process.(Default is 1e4.) |
A list with the following elements:
p0 |
vector of the estimated proportions of hypotheses
for each of p-value serie. |
tau |
the vector of posteriors. |
f1 |
a numeric vector, each coordinate
corresponding to the evaluation of the density at point ,
where is the th item in X. |
F1 |
a numeric vector, each coordinate
corresponding to the evaluation of the cdf at point ,
where is the th item in X.
|
Kernel estimation of the density in a two-components mixture model
where one component are a standard Gaussian density.
Here we suppose that the density to estimate lives in .
FastKerFdr_unsigned( X, p0 = NULL, plotting = FALSE, NbKnot = 1e+05, tol = 1e-05, max_iter = 10000 )FastKerFdr_unsigned( X, p0 = NULL, plotting = FALSE, NbKnot = 1e+05, tol = 1e-05, max_iter = 10000 )
X |
a vector of probit-transformed p-values (corresponding to a p-value serie) |
p0 |
a priori proportion of |
plotting |
boolean, should some diagnostic graphs be plotted. (Default is FALSE.) |
NbKnot |
The (maximum) number of knot for the |
tol |
a tolerance value for convergence. (Default is 1e-5.) |
max_iter |
the maximum number of iterations allowed for the algorithm to converge or complete its process.(Default is 1e4.) |
A list with the following elements:
p0 |
vector of the estimated proportions of hypotheses
for each of p-value serie. |
tau |
the vector of posteriors. |
f1 |
a numeric vector, each coordinate
corresponding to the evaluation of the density at point ,
where is the th item in X. |
F1 |
a numeric vector, each coordinate
corresponding to the evaluation of the cdf at point ,
where is the th item in X.
|
Computation of the sum sum_c(w_c*psi_c) using Gaussian copula parallelized version
fHconfig_sum_update_gaussian_copula_ptr_parallel( Hconfig, NewPrior, Logf0Mat, Logf1Mat, zeta0, zeta1, R, Rinv, threads_nb = 0L )fHconfig_sum_update_gaussian_copula_ptr_parallel( Hconfig, NewPrior, Logf0Mat, Logf1Mat, zeta0, zeta1, R, Rinv, threads_nb = 0L )
Hconfig |
list of vector of 0 and 1, corresponding to the configurations |
NewPrior |
a double vector containing the prior w_c |
Logf0Mat |
a double matrix containing the log(f0(xi_q)) |
Logf1Mat |
a double matrix containing the log(f1(xi_q)) |
zeta0 |
a double matrix containing the qnorm(F0(x_iq)) |
zeta1 |
a double matrix containing the qnorm(F1(x_iq)) |
R |
a double matrix corresponding to the copula parameter |
Rinv |
a double matrix corresponding to the inverse copula parameter |
threads_nb |
an int the number of threads |
a double vector containing sum_c(w_c*psi_c)
Computation of the sum sum_c(w_c*psi_c) parallelized version
fHconfig_sum_update_ptr_parallel( Hconfig, NewPrior, Logf0Mat, Logf1Mat, threads_nb = 0L )fHconfig_sum_update_ptr_parallel( Hconfig, NewPrior, Logf0Mat, Logf1Mat, threads_nb = 0L )
Hconfig |
list of vector of 0 and 1, corresponding to the configurations |
NewPrior |
a double vector containing the prior w_c |
Logf0Mat |
a double matrix containing the log(f0(xi_q)) |
Logf1Mat |
a double matrix containing the log(f1(xi_q)) |
threads_nb |
an int the number of threads |
a double vector containing sum_c(w_c*psi_c)
Gaussian copula density
gaussian_copula_density(zeta, R, Rinv)gaussian_copula_density(zeta, R, Rinv)
zeta |
the matrix of probit-transformed observations. |
R |
the correlation matrix. |
Rinv |
the inverse correlation matrix. |
A numeric vector, each coordinate corresponding to the evaluation of the Gaussian copula density function at observation .
test "AtLeast".Specify which configurations among Hconfig correspond
to the composite alternative hypothesis : {at least "AtLeast" hypotheses are of interest }
GetH1AtLeast(Hconfig, AtLeast, Consecutive = FALSE, SameSign = FALSE)GetH1AtLeast(Hconfig, AtLeast, Consecutive = FALSE, SameSign = FALSE)
Hconfig |
A list of all possible combination of |
AtLeast |
How many |
Consecutive |
Should the significant test series be consecutive ? (optional, default is |
SameSign |
Should the significant test series have the same sign ? (optional, default is |
A vector 'Hconfig.H1' of components of Hconfig that correspond to the 'AtLeast' specification.
GetH1AtLeast(GetHconfig(4), 2)GetH1AtLeast(GetHconfig(4), 2)
test "Equal".Specify which configurations among Hconfig correspond
to the composite alternative hypothesis :{Exactly "Equal" hypotheses are of interest }
GetH1Equal(Hconfig, Equal, Consecutive = FALSE, SameSign = FALSE)GetH1Equal(Hconfig, Equal, Consecutive = FALSE, SameSign = FALSE)
Hconfig |
A list of all possible combination of H0 and H1 hypotheses generated by the GetHconfig() function. |
Equal |
What is the exact number of |
Consecutive |
Should the significant test series be consecutive ? (optional, default is FALSE). |
SameSign |
Should the significant test series have the same sign ? (optional, default is FALSE). |
A vector 'Hconfig.H1' of components of Hconfig that correspond to the 'Equal' specification.
GetH1Equal(GetHconfig(4), 2)GetH1Equal(GetHconfig(4), 2)
/ configurations.Generate all possible combination of simple hypotheses /.
GetHconfig(Q, Signed = FALSE)GetHconfig(Q, Signed = FALSE)
Q |
The number of test series to be combined. |
Signed |
Should the sign of the effect be taken into account? (optional, default is |
A list 'Hconfig' of all possible combination of and hypotheses among hypotheses tested.
GetHconfig(4)GetHconfig(4)
This function is a re-implementation of the initial R loop computing last incomplete trapezoid. See R function integral.kde_adapted().
last_incomplete_trapezoid_arma( q_prob, q_ind, q, eval, est, simp_rule, density = TRUE )last_incomplete_trapezoid_arma( q_prob, q_ind, q, eval, est, simp_rule, density = TRUE )
q_prob |
reference of the vector q_prob containing the probability of each quantile q |
q_ind |
reference of the vector q_ind |
q |
reference of the vector q containing the quantiles |
eval |
reference of the vector eval |
est |
reference of the vector est |
simp_rule |
reference of the vector simp_rule |
density |
logical |
void. Its first argument q_prob is passed as a reference and modified in place.
Update of the prior estimate in EM algo parallelized version
prior_update_arma_ptr_parallel( Hconfig, fHconfig_sum, OldPrior, Logf0Mat, Logf1Mat, threads_nb = 0L )prior_update_arma_ptr_parallel( Hconfig, fHconfig_sum, OldPrior, Logf0Mat, Logf1Mat, threads_nb = 0L )
Hconfig |
list of vector of 0 and 1, corresponding to the configurations |
fHconfig_sum |
a double vector containing sum_c(w_c*psi_c), obtained by fHconfig_sum_update_ptr_parallel() |
OldPrior |
a double vector containing the prior w_c |
Logf0Mat |
a double matrix containing the log(f0(xi_q)) |
Logf1Mat |
a double matrix containing the log(f1(xi_q)) |
threads_nb |
an int the number of threads |
a double vector containing the new estimate of prior w_c
Update of the prior estimate in EM algo using Gaussian copula, parallelized version
prior_update_gaussian_copula_ptr_parallel( Hconfig, fHconfig_sum, OldPrior, Logf0Mat, Logf1Mat, zeta0, zeta1, R, Rinv, threads_nb = 0L )prior_update_gaussian_copula_ptr_parallel( Hconfig, fHconfig_sum, OldPrior, Logf0Mat, Logf1Mat, zeta0, zeta1, R, Rinv, threads_nb = 0L )
Hconfig |
list of vector of 0 and 1, corresponding to the configurations |
fHconfig_sum |
a double vector containing sum_c(w_c*psi_c), obtained by fHconfig_sum_update_ptr_parallel() |
OldPrior |
a double vector containing the prior w_c |
Logf0Mat |
a double matrix containing the log(f0(xi_q)) |
Logf1Mat |
a double matrix containing the log(f1(xi_q)) |
zeta0 |
a double matrix containing the qnorm(F0(x_iq)) |
zeta1 |
a double matrix containing the qnorm(F1(x_iq)) |
R |
a double matrix corresponding to the copula parameter |
Rinv |
a double matrix corresponding to the inverse copula parameter |
threads_nb |
an int the number of threads |
a double vector containing the new estimate of prior w_c
PvalSets is a data.frame with 10,000 rows and 3 columns. Each row corresponds to an item,
columns 'Pval1' and 'Pval2' each correspond to a test serie over the items, and column 'Class'
provides the truth, i.e. if item belongs to class 1 then the H0 hypothesis is true for the 2 tests,
if item belongs to class 2 (resp. 3) then the H0 hypothesis is true for the first (resp. second)
test only, and if item belongs to class 4 then both H0 hypotheses are false (for the first
and the second test).
PvalSetsPvalSets
A data.frame
PvalSets_cor is a data.frame with 10,000 rows and 3 columns. Each row corresponds to an item,
columns Pval1 and Pval2 each correspond to a test serie over the items, and column 'Class'
provides the truth, i.e. if item belongs to class 1 then the hypothesis is true for the 2 tests,
if item belongs to class 2 (resp. 3) then the hypothesis is true for the first (resp. second)
test only, and if item belongs to class 4 then both H0 hypotheses are false (for the first
and the second test). The correlation between the two pvalues series within each class is 0.3.
PvalSets_corPvalSets_cor
A data.frame
/ configurations.For each item, estimate the posterior probability for each configuration.
This function use either the model accounting for the dependence structure
through a Gaussian copula function (copula=="gaussian") or
assuming the conditional independence (copula=="indep").
Utilizes parallel computing, when available. For package documentation, see qch-package.
qch.fit( pValMat, EffectMat = NULL, Hconfig, copula = "indep", memory_efficient_EM = FALSE, threads_nb = 0, plotting = FALSE, Precision = 1e-06 )qch.fit( pValMat, EffectMat = NULL, Hconfig, copula = "indep", memory_efficient_EM = FALSE, threads_nb = 0, plotting = FALSE, Precision = 1e-06 )
pValMat |
A matrix of p-values, each column corresponding to a p-value serie. |
EffectMat |
A matrix of estimated effects corresponding to the p-values contained in |
Hconfig |
A list of all possible combination of |
copula |
A string specifying the form of copula to use. Possible values are " |
memory_efficient_EM |
Logical. If |
threads_nb |
Integer. Number of threads to use for parallel computation.
This parameter is only used when |
plotting |
Logical. Should some diagnostic graphs be plotted ? Default is |
Precision |
The precision for EM algorithm to infer the parameters. Default is |
A list with the following elements:
prior |
vector of estimated prior probabilities for each of the H-configurations. |
Rcopula |
the estimated correlation matrix of the Gaussian copula. (if applicable) |
Hconfig |
the list of all configurations. |
null_prop |
the estimation of items under the null for each test series. |
If the memory efficient version of EM algorithm is not used, the list will additionally contain:
posterior |
matrix providing for each item (in row) its posterior probability to belong to each of the H-configurations (in columns). |
fHconfig |
matrix containing densities evaluated at each items,
each column corresponding to a configuration.
|
Else, the list will additionally contain:
f0Mat |
matrix containing the evaluation of the marginal densities under at each items,
each column corresponding to a p-value serie. |
f1Mat |
matrix containing the evaluation of the marginal densities under at each items,
each column corresponding to a p-value serie. |
F0Mat |
matrix containing the evaluation of the marginal cdf under at each items,
each column corresponding to a p-value serie. |
F1Mat |
matrix containing the evaluation of the marginal cdf under at each items,
each column corresponding to a p-value serie. |
fHconfig_sum |
vector containing for each items .
|
The elements of interest are the posterior probabilities matrix, posterior,
the estimated proportion of observations belonging to each configuration, prior, and
the estimated correlation matrix of the Gaussian copula, Rcopula.
The remaining elements are returned primarily for use by other functions.
data(PvalSets_cor) PvalMat <- as.matrix(PvalSets_cor[, -3]) ## Build the Hconfig objects Q <- 2 Hconfig <- GetHconfig(Q) ## Run the function res.fit <- qch.fit(pValMat = PvalMat, Hconfig = Hconfig, copula = "gaussian") ## Display the prior of each class of items res.fit$prior ## Display the correlation estimate of the gaussian copula res.fit$Rcopula ## Display the first posteriors head(res.fit$posterior)data(PvalSets_cor) PvalMat <- as.matrix(PvalSets_cor[, -3]) ## Build the Hconfig objects Q <- 2 Hconfig <- GetHconfig(Q) ## Run the function res.fit <- qch.fit(pValMat = PvalMat, Hconfig = Hconfig, copula = "gaussian") ## Display the prior of each class of items res.fit$prior ## Display the correlation estimate of the gaussian copula res.fit$Rcopula ## Display the first posteriors head(res.fit$posterior)
Perform any composite hypothesis test by specifying
the configurations 'Hconfig.H1' corresponding to the composite alternative hypothesis
among all configurations 'Hconfig'.
qch.test(res.qch.fit, Hconfig, Hconfig.H1 = NULL, Alpha = 0.05, threads_nb = 0)qch.test(res.qch.fit, Hconfig, Hconfig.H1 = NULL, Alpha = 0.05, threads_nb = 0)
res.qch.fit |
The result provided by the qch.fit() function. |
Hconfig |
A list of all possible combination of |
Hconfig.H1 |
An integer vector (or a list of such vector) of the |
Alpha |
the nominal Type I error rate for FDR control. Default is |
threads_nb |
The number of threads to use. The number of thread will set to the number of cores available by default. |
By default, the function performs the composite hypothesis test of being associated with "at least " simple tests, for .
A list with the following elements:
Rejection |
a matrix providing for each item the result of the composite hypothesis test, after adaptive Benjamin-Höchberg multiple testing correction. |
lFDR |
a matrix providing for each item its local FDR estimate. |
Pvalues |
a matrix providing for each item its p-value of the composite hypothesis test. |
qch.fit(), GetH1AtLeast(), GetH1Equal()
data(PvalSets_cor) PvalMat <- as.matrix(PvalSets_cor[, -3]) Truth <- PvalSets[, 3] ## Build the Hconfig objects Q <- 2 Hconfig <- GetHconfig(Q) ## Infer the posteriors res.fit <- qch.fit(pValMat = PvalMat, Hconfig = Hconfig, copula = "gaussian") ## Run the test procedure with FDR control H1config <- GetH1AtLeast(Hconfig, 2) res.test <- qch.test(res.qch.fit = res.fit, Hconfig = Hconfig, Hconfig.H1 = H1config) table(res.test$Rejection$AtLeast_2, Truth == 4)data(PvalSets_cor) PvalMat <- as.matrix(PvalSets_cor[, -3]) Truth <- PvalSets[, 3] ## Build the Hconfig objects Q <- 2 Hconfig <- GetHconfig(Q) ## Infer the posteriors res.fit <- qch.fit(pValMat = PvalMat, Hconfig = Hconfig, copula = "gaussian") ## Run the test procedure with FDR control H1config <- GetH1AtLeast(Hconfig, 2) res.test <- qch.test(res.qch.fit = res.fit, Hconfig = Hconfig, Hconfig.H1 = H1config) table(res.test$Rejection$AtLeast_2, Truth == 4)
Update the estimate of R correlation matrix of the gaussian copula, parallelized version
R_MLE_update_gaussian_copula_ptr_parallel( Hconfig, fHconfig_sum, OldPrior, Logf0Mat, Logf1Mat, zeta0, zeta1, OldR, OldRinv, RhoIndex, threads_nb = 0L )R_MLE_update_gaussian_copula_ptr_parallel( Hconfig, fHconfig_sum, OldPrior, Logf0Mat, Logf1Mat, zeta0, zeta1, OldR, OldRinv, RhoIndex, threads_nb = 0L )
Hconfig |
list of vector of 0 and 1, corresponding to the configurations |
fHconfig_sum |
a double vector containing sum_c(w_c*psi_c), obtained by fHconfig_sum_update_ptr_parallel() |
OldPrior |
a double vector containing the prior w_c |
Logf0Mat |
a double matrix containing the log(f0(xi_q)) |
Logf1Mat |
a double matrix containing the log(f1(xi_q)) |
zeta0 |
a double matrix containing the qnorm(F0(x_iq)) |
zeta1 |
a double matrix containing the qnorm(F1(x_iq)) |
OldR |
a double matrix corresponding to the copula parameter |
OldRinv |
a double matrix corresponding to the inverse copula parameter |
RhoIndex |
a int matrix containing the index of lower triangular part of a matrix |
threads_nb |
an int the number of threads |
a double vector containing the lower triangular part of the MLE of R
Gaussian copula correlation matrix Maximum Likelihood estimator.
R.MLE(Hconfig, zeta0, zeta1, Tau)R.MLE(Hconfig, zeta0, zeta1, Tau)
Hconfig |
A list of all possible combination of |
zeta0 |
a matrix containing the |
zeta1 |
a matrix containing the |
Tau |
a matrix providing for each item (in row) its posterior probability to belong to each of the H-configurations (in columns). |
Estimate of the correlation matrix.
Check the Gaussian copula correlation matrix Maximum Likelihood estimator
R.MLE.check(R)R.MLE.check(R)
R |
Estimate of the correlation matrix. |
Estimate of the correlation matrix.
Gaussian copula correlation matrix Maximum Likelihood estimator (memory handling)
R.MLE.memory( Hconfig, fHconfig_sum, OldPrior, Logf0Mat, Logf1Mat, zeta0, zeta1, OldR, OldRinv )R.MLE.memory( Hconfig, fHconfig_sum, OldPrior, Logf0Mat, Logf1Mat, zeta0, zeta1, OldR, OldRinv )
Hconfig |
A list of all possible combination of |
fHconfig_sum |
a vector containing |
OldPrior |
a vector containing the prior probabilities for each of the H-configurations. |
Logf0Mat |
a matrix containing |
Logf1Mat |
a matrix containing |
zeta0 |
a matrix containing |
zeta1 |
a matrix containing |
OldR |
the copula correlation matrix. |
OldRinv |
the inverse of copula correlation matrix. |
Estimate of the correlation matrix.
Same as function above but does not handle the index ordering of the vector q. Therefore, the 2nd argument order_q has to be an index ordered version of the vector q. Indeed, the R base function: order() is twice as fast as the arma::sort_index(q) This is therefore the recommended function to use.
remove_decreasing_values_cpp(q_prob, order_q, tol = 1e-10)remove_decreasing_values_cpp(q_prob, order_q, tol = 1e-10)
q_prob |
reference of the vector q_prob |
order_q |
reference of the vector q |
tol |
By default 1e-10 |
void. Its first argument q_prob is passed as a reference and modified in place.
This function is a re-implementation of the initial R side while loop. See the end of R function integral.kde_adapted(). As shown in the commentary below, it is twice as slow to handle the index ordering of the vector q (2nd argument) here with the function arma::sort_index(). Consequently, it is recommended to use the function remove_decreasing_values_cpp() instead.
remove_decreasing_values_cpp_slow_ordering(q_prob, q, tol = 1e-10)remove_decreasing_values_cpp_slow_ordering(q_prob, q, tol = 1e-10)
q_prob |
reference of the vector q_prob |
q |
reference of the vector q |
tol |
By default 1e-10 |
void. Its first argument q_prob is passed as a reference and modified in place.