search for: bwmethod

Displaying 2 results from an estimated 2 matches for "bwmethod".

Did you mean: brmethod
2011 Sep 10
0
npreg: plotting out of sample, extremely large bandwidths
...^2 + x2^2 + x1*x2 + e mydata <- data.frame(x1=x1,x2=x2,y=y,e=e) summary(mydata) rm(x1,x2,y,e) # PROBLEM 1: plotting out of sample # example 1: do not restrict data to x1>=x2 # calculate bandwidth using npregbw() bandwidth <- npregbw(formula = y ~ x1 + x2, regtype="ll", bwmethod="cv.aic", data=mydata) summary(bandwidth) # perform nonparametric regression using bandwidth results <- npreg(bws=bandwidth) summary(results) # use plot to plot results plot(results,view="fixed",theta=300) # example 2: restrict data to observations for which x1>=x2...
2009 Dec 14
0
Confused on using expand.grid(), array(), image() and npudens(np) in my case
...,150)) plot(d1);points(d2,col="red");points(d3,col="green") attach(d) #Confusion1:how to specify the formula in the npudensbw() correctly? I find the sequence of ordered(tf)+x+y is important and here i may have a wrong specification bw <- npudensbw(formula=~ordered(tf)+x+y, bwmethod="cv.ml") #confusion1 year.seq <- sort(unique(d$tf)) #length is 3 x.seq <- seq(0,1,0.02) #length is 51 y.seq <- seq(0,1,0.02) #length is 51 #Confusion2:what is the correct sequence for the three variables (year.seq,x.seq and y.seq) in expand.grid() data.eval <- expand.gr...