data(preci)
coordinates(preci)<-~x+y
# optimizing eta
graph.rbf(prec~1, preci, eta.opt=TRUE, rho.opt=FALSE, n.neigh=9, func="TPS",
np=40, eta.dmax=0.2, P.T=TRUE)
## Not run:
# # optimizing rho
# graph.rbf(prec~x+y, preci, eta.opt=FALSE, rho.opt=TRUE, n.neigh=9, func="M",
# np=20, rho.dmax=2, P.T=TRUE)
# # optimizing eta and rho
# tps.lo <- graph.rbf(prec~1, preci, eta.opt=TRUE, rho.opt=TRUE, n.neigh=9, func="TPS",
# eta.dmax=2, rho.dmax=2, x0=c(0.1,0.1), iter=40)
# tps.lo$Opt # best combination of eta and rho obtained
# # other optimization options
# opt.u <- uobyqa(c(0.1,0.1), rbf.cv1, control = list(maxfun=40), formula=prec~1, data=preci,
# n.neigh=9, func="TPS")
# opt.n <- newuoa(c(0.1,0.1), rbf.cv1, control = list(maxfun=40), formula=prec~1, data=preci,
# n.neigh=9, func="TPS")
# # lattice of RMSPE values associated with a range of eta and rho, without optimization
# tps.l <- graph.rbf(prec~1, preci, eta.opt=FALSE, rho.opt=FALSE, n.neigh=9, func="TPS",
# np=10, eta.dmax=2, rho.dmax=2)
# tps.l$opt.table # best combination of eta and rho obtained from lattice
# tps.ls$pplot # lattice of RMSPE
# ## End(Not run)
Run the code above in your browser using DataLab