get_estimates_naive {CJAMP}R Documentation

Naive estimates of the copula and marginal parameters.

Description

Function to compute naive estimates of the copula parameter(s) and maximum likelihood (ML) estimates of the marginal parameters in a joint copula model of Y1 and Y2 given the predictors of Y1 and Y2. The main use of the function is to provide parameter starting values for the optimization of the log-likelihood function of the joint copula model in cjamp in order to obtain maximum likelihood estimates in the copula model.

Usage

get_estimates_naive(Y1 = NULL, Y2 = NULL, predictors_Y1 = NULL,
  predictors_Y2 = NULL, copula_param = "both")

Arguments

Y1

Numeric vector containing the first phenotype.

Y2

Numeric vector containing the second phenotype.

predictors_Y1

Dataframe containing the predictors of Y1 in columns.

predictors_Y2

Dataframe containing the predictors of Y2 in columns.

copula_param

String indicating whether estimates should be computed for \phi ("phi"), for \theta ("theta"), or both ("both").

Details

The estimates of the copula parameter(s) include estimates of \phi (if copula_param == "phi"), \theta (if copula_param == "theta") or both (if copula_param == "both"). They are obtained by computing Kendall's tau between Y1 and Y2 and using the relationship \tau = \phi/(\phi+2) of the Clayton copula to obtain an estimate of \phi and \tau = (\theta-1)/\theta of the Gumbel copula to obtain an estimate of \theta.

The ML estimates of the marginal parameters include estimates of the log standard deviations of Y1, Y2 given their predictors (log(\sigma1), log(\sigma2)) and of the effects of predictors_Y1 on Y1 and predictors_Y2 on Y2. The estimates of the marginal effects are obtained from linear regression models of Y1 given predictors_Y1 and Y2 given predictors_Y2, respectively. If single nucleotide variants (SNVs) are included as predictors, the genetic effect estimates are obtained from an underlying additive genetic model if SNVs are provided as 0-1-2 genotypes and from an underlying dominant model if SNVs are provided as 0-1 genotypes.

Value

Vector of the numeric estimates of the copula parameters log(\phi) and/or log(\theta-1), of the marginal parameters (log(\sigma1), log(\sigma2), and estimates of the effects of the predictors predictors_Y1 on Y1 and predictors_Y2 on Y2).

Examples

# Generate genetic data:
set.seed(10)
genodata <- generate_genodata(n_SNV = 20, n_ind = 1000)

# Generate phenotype data:
phenodata <- generate_phenodata_2_copula(genodata = genodata, MAF_cutoff = 1,
                                         prop_causal = 0.5, tau = 0.2,
                                         b1 = 0.3, b2 = 0.3)
predictors <- data.frame(X1 = phenodata$X1, X2 = phenodata$X2,
                         SNV = genodata$SNV1)

get_estimates_naive(Y1 = phenodata$Y1, Y2 = phenodata$Y2,
                    predictors_Y1 = predictors, predictors_Y2 = predictors,
                    copula_param = "both")


[Package CJAMP version 0.1.1 Index]