loss_function: loss-function with penalization

Description Usage Arguments Value

View source: R/functions.R

Description

calculates logclik with or without penalization for DIF-model given data, parameter values for items, DIF-parameters per variable per item and value of lambda

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
loss_function(
  data,
  covariates,
  beta_intercept = rep(0, ncol(data)),
  delta_matrix = matrix(0, ncol(covariates), ncol(data)),
  DIFmodel = "RM",
  restr_pen = FALSE,
  lambda = 0.5,
  lambda_restr = 100
)

Arguments

data

Answers of all persons (0/1, n x I)

covariates

Matrix of covariate values of all persons (n x ncovs)

beta_intercept

vecotr of parameter values for intercepts per item

delta_matrix

Matrix (ncovs x nitems) of DIF-parameters per variable and item

DIFmodel

can be "items", "variables", "all.interactions", "none". And FALSE for Rasch model estimation

restr_pen

For additional penalization to ensure zero sum of intercepts

lambda

penalization parameter

lambda_restr

penalization parameter for restriction

Value

the value of the (penalized) log conditional Likelihood


submission-user/cmlDIFlasso documentation built on Dec. 23, 2021, 6:40 a.m.