DHfun: Compute the first and second derivatives of the negative log...

View source: R/DHfun.R

DHfunR Documentation

Compute the first and second derivatives of the negative log likelihoods

Description

DHfun computes the first and second derivatives of the negative log likelihoods for a set of examinees. Items can be either binary or multi-option. The analysis is within the closed interval [0,100].

Usage

  DHfun(theta, WfdList, Umat)

Arguments

theta

Initial values for score indices in [0,n]/[0,100]. Vector of size N.

WfdList

A numbered list object produced by a TestGardener analysis of a test. Its length is equal to the number of items in the test or questions in the scale. Each member of WfdList is a named list containing information computed during the analysis. These named lists contain these objects:

Wfd:

A functional data object containing the M surprisal curves for a question.

M:

The number of options.

Pbin:

A matrix containing proportions at each bin.

Wbin:

A matrix containing surprisal values at each bin.

Pmatfine:

A matrix of probabilities over a fine mesh.

Wmatfine:

A matrix of surprisal values over a fine mesh.

DWmatfine:

A matrix of the values of the first derivative of surprisal curves over fine mesh.

D2Wmatfine:

A matrix of the values of the second derivative of surprisal curves over fine mesh.

Umat

An N by n matrix of responses. If N = 1, it can be a vector of length n.

Value

A named list for results DH and D2H:

DH:

First derivatives of the negative log likelihood values, vector of size N

D2H:

Second derivatives of the negative log likelihood values, vector of size N

Author(s)

Juan Li and James Ramsay

References

Ramsay, J. O., Li J. and Wiberg, M. (2020) Full information optimal scoring. Journal of Educational and Behavioral Statistics, 45, 297-315.

Ramsay, J. O., Li J. and Wiberg, M. (2020) Better rating scale scores with information-based psychometrics. Psych, 2, 347-360.

http://testgardener.azurewebsites.net

See Also

make.dataList, Hfun, Hfuns.plot

Examples

#  Example 1:
#  Compute the first and second derivative values of the objective function for 
#  locating each examinee for the 24-item short form of the SweSAT quantitative  
#  test on thepercentile score index continuum.
WfdList <- Quantshort_parList$WfdList
theta   <- Quantshort_parList$theta
U       <- Quantshort_dataList$U
DHfunResult <- DHfun(theta, WfdList, U)
DHval  <- DHfunResult$DH
D2Hval <- DHfunResult$D2H
print(paste("Mean               of objective gradient =",round(mean(DHval),4)))
print(paste("Standard deviation of objective gradient =",round(sqrt(var(DHval)),4)))
print(paste("Mean               of objective Hessian =",round(mean(D2Hval),4)))
print(paste("Standard deviation of objective Hessian =",round(sqrt(var(D2Hval)),6)))
#  Example 2:
#  Compute the first and second derivative values of the objective function for 
#  locating each examinee for the 13-item Symptom Distress scale  
#  on the percentile score index continuum.
#  Proceed as above changing "Quant" for "SDS".

TestGardener documentation built on June 27, 2022, 1:05 a.m.