# NOT RUN {
#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)
# }
Run the code above in your browser using DataLab