Q_theta: Likelihood function

Description Usage Arguments Value Note

View source: R/utility_functions.R

Description

calculates likelihood function. Used to assess convergence of fitting algorithm. This corresponds to the Q(theta) function in the paper

Usage

1
2
Q_theta(x, y, beta, gamma, weights, lambda.beta, lambda.gamma,
  main.effect.names, interaction.names)

Arguments

x

Design matrix of dimension n x q, where n is the number of subjects and q is the total number of variables; each row is an observation vector. This must include all main effects and interactions as well, with column names corresponding to the names of the main effects (e.g. x1, x2, E) and their interactions (e.g. x1:E, x2:E). All columns should be scaled to have mean 0 and variance 1; this is done internally by the shim function.

y

response variable (matrix form) of dimension n x 1

beta

p x 1 matrix of main effect estimates

gamma

p*(p-1)/2 x 1 matrix of gamma estimates

weights

adaptive weights calculated by ridge_weights function with rownames corresponding to column names of x

lambda.beta

a single tuning parameter for main effects

lambda.gamma

a single tuning parameter for gammas

main.effect.names

character vector of main effects names

interaction.names

character vector of interaction names. must be separated by a colon (e.g. x1:E)

Value

value of likelihood function

Note

you dont use the intercept in the calculation of the Q function because its not being penalized


sahirbhatnagar/shim documentation built on May 29, 2019, 12:59 p.m.