Learn R Programming

qch (version 2.1.2)

qch.fit: Infer posterior probabilities of \(H_0\)/\(H_1\) configurations.

Description

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.

Usage

qch.fit(
  pValMat,
  EffectMat = NULL,
  Hconfig,
  copula = "indep",
  threads_nb = 0,
  plotting = FALSE,
  Precision = 1e-06
)

Value

A list with the following elements:

priorvector of estimated prior probabilities for each of the H-configurations.
Rcopulathe estimated correlation matrix of the Gaussian copula. (if applicable)
Hconfigthe list of all configurations.
null_propthe estimation of items under the null for each test series.

  • If the storage permits, the list will additionally contain:

    posteriormatrix providing for each item (in row) its posterior probability to belong to each of the H-configurations (in columns).
    fHconfigmatrix containing \(\psi_c\) densities evaluated at each items, each column corresponding to a configuration.
  • Else, the list will additionally contain:

    f0Matmatrix containing the evaluation of the marginal densities under \(H_0\) at each items, each column corresponding to a p-value serie.
    f1Matmatrix containing the evaluation of the marginal densities under \(H_1\) at each items, each column corresponding to a p-value serie.
    F0Matmatrix containing the evaluation of the marginal cdf under \(H_0\) at each items, each column corresponding to a p-value serie.
    F1Matmatrix containing the evaluation of the marginal cdf under \(H_1\) at each items, each column corresponding to a p-value serie.
    fHconfig_sumvector containing \((\sum_cw_c\psi_c(Z_i))\) for each items \(i\).

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.

Arguments

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 pValMat. If specified, the procedure will account for the direction of the effect. (optional, default is NULL)

Hconfig

A list of all possible combination of \(H_0\) and \(H_1\) hypotheses generated by the GetHconfig() function.

copula

A string specifying the form of copula to use. Possible values are "indep"and "gaussian". Default is "indep" corresponding to the independent case.

threads_nb

The number of threads to use. The number of thread will set to the number of cores available by default.

plotting

A boolean. Should some diagnostic graphs be plotted ? Default is FALSE.

Precision

The precision for EM algorithm to infer the parameters. Default is 1e-6.

Examples

Run this code
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)

Run the code above in your browser using DataLab