##
## vector response with functional explanatory variable
##
if (FALSE) {
annualprec <- log10(apply(CanadianWeather$dailyAv[,,
"Precipitation.mm"], 2,sum))
smallbasis <- create.fourier.basis(c(0, 365), 25)
tempfd <- smooth.basis(day.5,
CanadianWeather$dailyAv[,,"Temperature.C"], smallbasis)$fd
precip.Temp.f <- fRegress(annualprec ~ tempfd)
precip.Temp.p <- predict(precip.Temp.f)
# plot response vs. fitted
oldpar <- par(no.readonly=TRUE)
plot(annualprec, precip.Temp.p)
par(oldpar)
}
Run the code above in your browser using DataLab