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 |
predictors_Y2 |
Dataframe containing the predictors of |
copula_param |
String indicating whether estimates should be computed
for |
Details
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 of the Clayton
copula to obtain an estimate of
and
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 ()
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
and/or
, of the marginal
parameters (
, 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")