nw<-function(t,x,y,h){
	B=dnorm(outer(t,x,"-")/h)
	L=B/apply(B,1,sum)
	estimador=L%*%y
	return(estimador)
}

ll<-function(t,x,y,h)

matrizLNW<-function(x,h){
	B=dnorm(outer(x,x,"-")/h)
	L=B/apply(B,1,sum)
	return(L)
}

CV<-function(x,y,H){
	D=outer(x,x,"-")
	nH=length(H)
	CVh=numeric(nH)
	for (i in 1:nH){
		B=dnorm(D/H[i])
		L=B/apply(B,1,sum)
		mgorro=L%*%y
		CVh[i]=mean((y-mgorro)^2/(1-diag(L))^2)}
return(CVh)
}
