Displaying 1 result from an estimated 1 matches for "ybar4".
Did you mean:
ybar
2010 Nov 18
0
On efficiency, Vectorize and loops
...or (t in 1:n){
Ybar<-Ybar+Y[[t]](u)
}
Ybar<-1/n*Ybar
}
Ybar2<-function(u){
Ybar2<-0
for (t in 1:n){
Ybar2<-Ybar2+Y2[[t]](u)
}
Ybar2<-1/n*Ybar2
}
Ybar3<-function(u){
Ybar3<-0
for (t in 1:n){
Ybar3<-Ybar3+Y3[[t]](u)
}
Ybar3<-1/n*Ybar3
}
Ybar4<-function(u){
Ybar4<-0
for (t in 1:n){
Ybar4<-Ybar4+Y4[[t]](u)
}
Ybar4<-1/n*Ybar4
}
# Defining the inner product on L^2([a,b])
inner.product<-function(f,g){
core<-function(u){
core<-f(u)*g(u)
}
inner.product<-integrate(core,a,b)$value
}
##############...