BestM: Chooses the size of the polynomial basis

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/LPBkg.R

Description

Computes the deviance p-values considering different sizes of the polynomial basis and selects the one for which the deviance p-value is the smallest.

Usage

1
BestM(data, g, Mmax = 20, range = c(min(data),max(data)))

Arguments

data

A vector of data. See details.

g

The postulated model from which we want to assess if deviations occur.

Mmax

The maximum size of the polynomial basis from which a suitable value M is selected (the default is 20). See details.

range

Range of the data/ search region considered.

Details

The argument data collects the data for which we want to test if deviations occur from the postulated model specified in the argument g. As in Algeri, 2019, the sample specified under data corresponds to the source-free sample in the background calibration phase and to the physics sample in the signal search phase. The value M selected determines the smoothness of the estimated comparison density, with smaller values of M leading to smoother estimates. The deviance test is used to select the value M which leads to the most significant deviation from the postulated model. The default value for Mmax is set to 20. Notice that numerical issues may arise for larger values of Mmax.

Value

pvals

The deviance test p-value obtained for each values of M (from 1 to Mmax) considered.

minp

The minimum value of the deviance p-values observed.

Msel

The value of M at which the minimum deviance p-values is achieved.

Author(s)

Sara Algeri

References

S. Algeri, 2019. Detecting new signals under background mismodelling <arXiv:1906.06615>.

See Also

denoise, dhatL2.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#Generating data
x<-rnorm(1000,10,7)
data<-x[x>=10 & x<=20]

#Create suitable postulated quantile function of data
G<-pnorm(20,5,15)-pnorm(10,5,15)
g<-function(x){dnorm(x,5,15)/G}

Mmax=10
range=c(10,20)

BestM(data,g,Mmax,range)

LPBkg documentation built on Oct. 5, 2019, 1:05 a.m.

Related to BestM in LPBkg...