# Read data
library(e1071)
n= 500
t= seq(0,1,len=101)
beta = t*sin(2*pi*t)^2
x = matrix(NA, ncol=101, nrow=n)
y=numeric(n)
for (i in 1:n){
x[i,] = rwiener(1,101)*3 + rnorm(101,sd=0.1)
y[i] = mean((x[i,])*beta)+rnorm(1,sd=0.1)
}
prx=x[1:100,];pry=y[1:100]
ind=101;ind2=102:110
pr0=x[ind,];pr10=x[ind2,]
ndist=61
gridy=seq(-1.598069,1.598069, len=ndist)
# Conditional Function
res1 = cond.F(pr10, gridy, prx, pry,p=1)
res2 = cond.F(pr10, gridy, prx, pry,h=0.3)
res3 = cond.F(pr10, gridy, prx, pry,g=0.25,h=0.3)
plot(res1$Fc[,1],type="l",ylim=c(0,1))
lines(res2$Fc[,1],type="l",col=2)
lines(res3$Fc[,1],type="l",col=3)Run the code above in your browser using DataLab