Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/functions_only.R
Estimates the comparison density for continuous and discrete data.
1 |
data |
A data vector. See details. |
m |
If |
g |
Function corresponding to the parametric start. See details. |
range |
Interval corresponding to the support of the continuous data distribution. |
lattice |
Support of the discrete data distribution. |
selection |
A logical argument indicating if model selection should be performed. See details. |
criterion |
If |
The argument data
collects the data for which we want to test if its distribution corresponds to the one of the postulated model specified in the argument g
. The parametric start is assumed to be fully specified and takes x
as the only argument.
The value m
determines the smoothness of the estimated comparison density, with smaller values of m
leading to smoother estimates.
If selection=TRUE
, the largest coefficient estimates are selected according to either the AIC or BIC criterion as described in Algeri and Zhang, 2020 (see also Ledwina, 1994 and Mukhopadhyay, 2017). The resulting estimator is the one in Gajek's formulation with orthonormal basis corresponding to LP score functions (see Algeri and Zhang, 2020 and Gajek, 1986).
LPj |
Estimates of the coefficients. |
du |
Function corresponding to the estimated comparison density in the u domain corresponding to the probability integral transformation. |
dx |
Function corresponding to the estimated comparison density in the x domain. |
f |
Function corresponding to the estimated probability function of the data. |
Sara Algeri and Xiangyu Zhang
Algeri S. and Zhang X. (2020). Smoothed inference and graphics via LP modeling.
Gajek, L. (1986). On improving density estimators which are not bona fide functions. The Annals of sStatistics, 14(4):1612–1618.
Ledwina, T. (1994). Data-driven version of neymany's smooth test of fit. Journal of the American Statistical Association, 89(427):1000–1005.
Mukhopadhyay, S. (2017). Large-scale mode identification and data-driven sciences. Electronic Journal of Statistics 11 (2017), no. 1, 215–240.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | library("LPBkg")
#Example discrete
data<-rbinom(1000,size=20,prob=0.5)
g<-function(x)dpois(x,10)/(ppois(20,10)-ppois(0,10))
ddhat<-d_hat(data,m=4,g, range=NULL,lattice=seq(0,20), selection=TRUE,criterion="BIC")
xx<-seq(0,20)
ddhat$dx(xx)
ddhat$LPj
#Example continuous
data<-rnorm(1000,0,1)
g<-function(x)dt(x,10)
ddhat<-d_hat(data,m=4,g, range=c(-100,100), selection=TRUE,criterion="AIC")
uu<-seq(0,1,length=10)
ddhat$du(uu)
ddhat$LPj
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.