# Compute the A matrix or "hat" matrix for a thin plate spline
# check that this gives the same predicted values
tps.out<-Tps( ozone$x, ozone$y)
A<-Krig.Amatrix( tps.out, ozone$x)
test<- A%*%ozone$y
# now compare this to predict( tps.out) or tps.out$fitted.values
# they should be the same
stats( test- tps.out$fitted.values)
Run the code above in your browser using DataLab