# NOT RUN {
#generating data
x<-rnorm(1000,10,7)
xx<-x[x>=10 & x<=20]
#create suitable postulated quantile function
G<-pnorm(20,5,15)-pnorm(10,5,15)
g<-function(x){dnorm(x,5,15)/G}
#Vectorize quantile function
g<-Vectorize(g)
u<-g(xx)
Mmax=20
S<- as.matrix(Legj(u=u,m=Mmax))
n<-length(u)
LP <- apply(S,FUN="mean",2)
denoise(LP,n=n,method="AIC")
# }
Run the code above in your browser using DataLab