Learn R Programming

hero (version 0.6)

predict.hero_radspline: Predict method for a hero_radspline

Description

Predicted values based on object created by radspline.

Usage

# S3 method for hero_radspline
predict(object, newx, sparse = TRUE, longlat = FALSE, join = TRUE, ...)

Value

An \(n \times k\) matrix (or

Matrix-class object if

sparse = TRUE), where \(n\) is the number of rows in newx and \(k\) is the number of basis functions in object. Each row gives the predicted values of each newx value evaluated at each of the basis functions.

Arguments

object

A hero_radspline object created by radspline.

newx

A numeric matrix at which to evaluate the radial basis splines functions.

sparse

A logical value indicating if the result should be a sparse version of the Matrix-class.

longlat

Use Euclidean (FALSE) or Great Circle (WGS84 ellipsoid) distance (TRUE). Default is FALSE.

join

A logical value. TRUE, the default, indicates that the predictions from each set of radial basis functions should be joined column-wise. Otherwise, a list with the predictions from each set of basis functions is returned.

...

Not currently implemented.

See Also

radspline

Examples

Run this code
border = border.grid(lon, lat)
r = radspline(nknots = c(36, 36 * 4), border = border)
newx = cbind(c(lon), c(lat))
p = predict(r, newx)

Run the code above in your browser using DataLab