# HDRs of model 11 in library NPCirc
library(NPCirc)
f1<-function(x){return(dcircmix(x,11))}
circ.hdr(f1,tau=0.2,shrink=1.5)
circ.hdr(f1,tau=0.8,shrink=1.5)
# \donttest{
# Plug-in level set estimation for regression
# with circular (x) - linear (y) data by using
# the Nadaraya-Watson estimator
f2<-function(t){
set.seed(1012)
n <- 100
x <- runif(n, 0, 2*pi)
y <- sin(x)+0.5*rnorm(n)
return(kern.reg.circ.lin(circular(x),y,t,bw=10,method="NW")$y)
}
circ.hdr(f2,level=.5,plot.hdr=FALSE)
# }
Run the code above in your browser using DataLab