
Maximize the log likelihood to infer the heritability enrichment fold(s).
Source:R/sHDL.optim.R
sHDL.optim.Rd
Maximize the log likelihood to infer the heritability enrichment fold(s).
Usage
sHDL.optim(
ref.data,
N,
start.v = NULL,
output.file = NULL,
log.file = "",
stepwise = TRUE,
fix.h2 = NULL,
fix.intercept = NULL,
lim = exp(-18),
verbose = FALSE,
lwr = NULL,
upr = NULL,
maxit = 1000,
pgtol = 0.001,
par.h2 = FALSE,
mc.cores = 1,
nthreads = 1
)
Arguments
- ref.data
A list of data matched to LD reference generated by
sHDL.joint.reduct.dim
.- N
The sample size of the GWAS.
- start.v
Starting values for
c(h2, intercept, fold1, fold2, ..., foldn)
, where n is the number of annotations. Default isNULL
, which meansc(0.1, 1, 1, ..., 1)
. Iffix.h2
orfix.intercept
is notNULL
, the starting values forh2
orintercept
will be ignored.- output.file
Where the 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
.- lwr
Lower bounds for
c(h2, intercept, fold1, fold2, ..., foldn)
. Default isNULL
, which meansc(0, 0, 0, 0, ..., 0)
. Whenfix.h2
orfix.intercept
is notNULL
. Whenfix.h2
orfix.intercept
is notNULL
, the lower bounds forh2
orintercept
will be ignored.- upr
Upper bounds for
c(h2, intercept, fold1, fold2, ..., foldn)
, default isNULL
, which meansc(1, 5, M/Md_1, M/Md_2, ..., M/Md_n)
, whereMd_i
is the sum of the weights of the i-th annotation. Whenfix.h2
orfix.intercept
is notNULL
, the upper bounds forh2
orintercept
will be ignored.- maxit
Maximum number of iterations, default maxit = 1000.
- pgtol
Tolerance for convergence, default pgtol = 1e-3.
- par.h2
Whether to estimate the partitioned heritability, default
par.h2 = FALSE
.- mc.cores
Number of cores to use for parallelization, default
mc.cores = 1
.- nthreads
Number of threads to use for matrix operations, default
nthreads = 1
. The default value is suitable for most cases, do not change it unless you are sure about the performance.- annots
A vector of annotation names, default
NULL
, which means all annotations in theDr.path
will be used.- lam.cut
Cutoff for the eigenvalues, default is
NULL
, which means no cutoff. For analyses with a limited number of traits and annotations, a lower cutoff (such as 0.1, or even not using a cutoff at all) is recommended. For large-scale analyses, a higher cutoff (such as 1) is recommended, to yield fast computation.