ridge_indep_em3: Function for estimating hyper-parameters for "independent"...

View source: R/ebmr.update.grr.R

ridge_indep_em3R Documentation

Function for estimating hyper-parameters for "independent" ridge regressions (ie the orthogonal case)

Description

Obtains maximum likelihood estimates for (s2,sb2) in the model

y_i | theta_i \sim N(theta_i, s2), theta_i \sim N(0,sb2 s2 d2_i),

where y,d2 are given and (s2,sb2) are to be estimated. However it uses a different parameterization to improve convergence (see details). It also incorporates additional sum of squares (ss) and degrees of freedom (df) which effectively specify a prior on s2 (necessary to deal with fitting ridge regression when n>p above).

Usage

ridge_indep_em3(
  y,
  d2,
  ss = 0,
  df = 0,
  tol = 0.001,
  maxiter = 1000,
  s2.init = 1,
  sb2.init = 1,
  l2.init = 1,
  update_s2 = TRUE
)

Arguments

y

numeric vector

d2

numeric vector

ss

sum of squares for prior on s2

df

degrees of freedom for ss

tol

real scalar, specifying convergence tolerance for log-likelihood

maxiter

integer, maximum number of iterations

s2.init

initial value for s2

sb2.init

initial value for sb2

l2.init

initial value for l2

update_s2

boolean; if false then s2 is fixed to s2.init

Details

This code is based on https://stephens999.github.io/misc/ridge_em_svd.html extended to take account of additional residual sum of squares (ss) and degrees of freedom parameter (df), to deal with the case n>p. To improve convergence (see URL above) it fits the model by using the over-parameterized model:

y_i | theta_i \sim N(sb theta_i,s^2), theta_i \sim N(0,l2 d2_i).

So it returns s2hat = s2 and sb2hat = sb2 *l2 / s2


stephenslab/ebmr.alpha documentation built on March 30, 2022, 3:49 a.m.