Description Usage Arguments Details Value Examples
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.
1 2 | get_estimates_naive(Y1 = NULL, Y2 = NULL, predictors_Y1 = NULL,
predictors_Y2 = NULL, copula_param = "both")
|
Y1 |
Numeric vector containing the first phenotype. |
Y2 |
Numeric vector containing the second phenotype. |
predictors_Y1 |
Dataframe containing the predictors of |
predictors_Y2 |
Dataframe containing the predictors of |
copula_param |
String indicating whether estimates should be computed
for φ ( |
The estimates of the copula parameter(s) include estimates of φ
(if copula_param == "phi"), θ (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 τ = φ/(φ+2) of the Clayton
copula to obtain an estimate of φ and τ = (θ-1)/θ
of the Gumbel copula to obtain an estimate of θ.
The ML estimates of the marginal parameters include estimates of the log standard
deviations of Y1, Y2 given their predictors (log(σ1), log(σ2))
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.
Vector of the numeric estimates of the copula parameters
log(φ) and/or log(θ-1), of the marginal
parameters (log(σ1), log(σ2), and estimates
of the effects of the predictors predictors_Y1
on Y1 and predictors_Y2 on Y2).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # 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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.