chiMix_pDiff: Difference from nominal P-values of a chi-squared mixture.

Description Usage Arguments Details Value

View source: R/density_estimation.R

Description

Match observed P-values to nominal P-values by rank and calculate total difference. Objective function of a chi-squared mixture is used. This function is optimized to estimate the unknown scale and degree of freedom parameters for the scaled chi-squared distribution under the alternative hypothesis.

Usage

1
chiMix_pDiff(par, data, sorted = FALSE)

Arguments

par

vector of two parameters for the alternative distribution: scale parameter [1] and degrees of freedom [2].

data

list with two elements: chi_mix (vector) and alt_prop (scalar).

sorted

logical, denoting whether data$chi_mix is sorted in decreasing order.

Details

The argument data should be a two-element list. The first element, named chi_mix, is a vector of the observed values from the chi-squared mixture. The second element, named alt_prop, is the proportion of statistics that come from the alternative distribution.

The order of parameters is important in par. The scale parameter should be in the first position; the degrees of freedom should be in the second position.

Value

A numeric value of the total (absolute) difference between observed P-values (given the parameters) and nominal P-values (given their ranks).


kjgleason/Primo documentation built on Sept. 7, 2021, 3:58 a.m.