Skip to contents

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 is NULL, which means c(0.1, 1, 1, ..., 1). If fix.h2 or fix.intercept is not NULL, the starting values for h2 or intercept 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. If fix.h2 and fix.intercept are not NULL, stepwise will be overridden.

fix.h2

Whether to fix the heritability to fix.h2 or estimate the heritability, default fix.h2 = NULL, which means estimate the heritability.

fix.intercept

Whether to fix the intercept to fix.intercept or estimate the intercept, default fix.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 is NULL, which means c(0, 0, 0, 0, ..., 0). When fix.h2 or fix.intercept is not NULL. When fix.h2 or fix.intercept is not NULL, the lower bounds for h2 or intercept will be ignored.

upr

Upper bounds for c(h2, intercept, fold1, fold2, ..., foldn), default is NULL, which means c(1, 5, M/Md_1, M/Md_2, ..., M/Md_n), where Md_i is the sum of the weights of the i-th annotation. When fix.h2 or fix.intercept is not NULL, the upper bounds for h2 or intercept 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 the Dr.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.

Value

A data.frame is returned with:

  • item The name of the parameter.

  • estimation The estimated value of the parameter.

  • se The standard error of the parameter.

  • p The p-value of the parameter.

  • note The note of the parameter.