https://github.com/cran/fields
Raw File
Tip revision: ce722edae3c1b9e1af2985ce3500b11058facf0e authored by Doug Nychka on 24 August 2006, 01:46:17 UTC
version 3.04
Tip revision: ce722ed
Tps.R
"Tps" <-
function (x, Y, m = NULL, p = NULL, scale.type = "range", 
    ...) 
{

    x <- as.matrix(x)
    d <- ncol(x)
    if (is.null(p)) {
        if (is.null(m)) {
            m <- max(c(2, ceiling(d/2 + 0.1)))
        }
        p <- (2 * m - d)
        if (p <= 0) {
            stop(" m is too small  you must have 2*m -d >0")
        }
    }

    if (!is.null(list(...)$lambda)) stop(
     "Tps does not currently support the fixed lambda option. 
                  See help(Tps) for details")

    Tpscall <- match.call()
    Tpscall$cov.function <- "Thin plate spline radial basis functions (rad.cov) "
    Krig(x, Y, cov.function = rad.cov, m = m, 
        scale.type = scale.type, outputcall = Tpscall, p = p, 
        ...)
}

back to top