https://github.com/cran/fields
Tip revision: ce722edae3c1b9e1af2985ce3500b11058facf0e authored by Doug Nychka on 24 August 2006, 01:46:17 UTC
version 3.04
version 3.04
Tip revision: ce722ed
Krig.transform.xY.R
Krig.transform.xY<- function(obj,knots, verbose=FALSE ){
# find all replcates and collapse to unique locations and mean response
# and pooled variances and weights.
out<- Krig.replicates( obj, verbose=verbose)
#
# save information about knots.
if (is.na(knots[1])) {
out$knots <- out$xM
out$mle.calc <- TRUE
out$knot.model <- FALSE
}
else {
out$mle.calc <- FALSE
out$knot.model <- TRUE
out$knots<- knots
}
#
# scale x, knot locations and save transformation info
#
out$xM <- transformx(out$xM, obj$scale.type, obj$x.center, obj$x.scale)
out$transform <- attributes(out$xM)
out$knots <- scale(out$knots, center = out$transform$x.center,
scale = out$transform$x.scale)
#
#
#verbose block
#
if (verbose) {
cat("transform", fill = TRUE)
print(out$transform)
}
if (verbose) {
cat("knots in transformed scale", fill = TRUE)
print(knots)
}
return( out)
}