Learn R Programming

deform (version 1.0.0)

predict.deform: Predict from a fitted deform object

Description

Predict from a fitted deform object

Usage

# S3 method for deform
predict(object, newdata = NULL, ...)

Value

A 2-column matrix of predicted x and y points for deformations and a (2 + q)-column matrix for q-dimensional expansions.

Arguments

object

a fitted deform object

newdata

a 2-column matrix of x and y coordinates

...

currently just a placeholder

Examples

Run this code

# \donttest{

# fit a deformation model
data(solar)
m0 <- deform(solar$x, solar$z, solar$n)

# predict D-space points for original locations
predict(m0)

# }

# predictions for one-dimensional expansion model with specified locations 
# and standard error estimates
data(solar)
m1 <- expand(solar$x, solar$z, solar$n)
xvals <- seq(-123.3, -122.2, by = .1)
yvals <- seq(49, 49.4, by = .1)
xyvals <- expand.grid(xvals, yvals)
predict(m1, xyvals, se.fit = TRUE)

Run the code above in your browser using DataLab