Maximize the log likelihood to infer the heritability enrichment fold.
Source:R/sHDL.optim.R
sHDL.optim.Rd
Maximize the log likelihood to infer the heritability enrichment fold.
Arguments
- ref.data
A list of data matched to LD reference generated by
sHDL.reduct.dim
.- N
The sample size of the GWAS.
- start.v
A vector of starting values
c(fold, h2, intercept)
for optimization.- output.file
Where the log and results should be written.
- log.file
Where the log should be written.
- stepwise
Whether to estimate enrichment fold by estimating heritability and intercept first, default
stepwise = FALSE
. Iffix.h2
andfix.intercept
are notNULL
,stepwise
will be overridden.- fix.h2
Whether to fix the heritability to
fix.h2
or estimate the heritability, defaultfix.h2 = NULL
, which means estimate the heritability.- fix.intercept
Whether to fix the intercept to
fix.intercept
or estimate the intercept, defaultfix.intercept = NULL
, which means estimate the intercept.- lim
Tolerance limitation to ensure the positive-definiteness of covariance matrices, default
lim = exp(-18)
.- verbose
Whether to print the log on the console, default
verbose = FALSE
.- clust
A cluster object generated by
parallel::makeCluster
.- lwr
Lower bounds for
c(fold, h2, intercept)
. Default isNULL
, which meansc(0, 0, 0.1)
.- upr
Upper bounds for
c(fold, h2, intercept)
. Default isNULL
, which meansc(M / Md, 1, 5)
, whereMd
is the sum of annotation weights andM
is the total number of SNPs.- maxit
Maximum number of iterations, default maxit = 1000.
- pgtol
Tolerance for convergence, default pgtol = 1e-3.
Value
A list is returned with:
time Time elapsed in seconds for optimization.
fold The estimated heritability enrichment fold.
h2 The estimated SNP-based heritability.
intercept The estimated intercept.
fold.se The standard error of the estimated heritability enrichment fold.
h2.se The standard error of the estimated heritability.
intercept.se The standard error of the estimated intercept.
fold.p P-value based on Wald test for the estimated heritability enrichment fold.
h2.p P-value based on Wald test for the estimated heritability.
intercept.p P-value based on Wald test for the estimated intercept.
stepwise Whether the optimization is done in a stepwise manner.
converged Whether the optimization converges.
message The message returned by
optim
.