Learn R Programming

deform (version 1.0.0)

simulate.deform: Simulate from a fitted deform object

Description

Simulate from a fitted deform object

Usage

# S3 method for deform
simulate(object, nsim = 1, seed = NULL, newdata = NULL, ...)

Value

Plots representing all one- or two-dimensional smooths

Arguments

object

a fitted deform object

nsim

an integer giving the number of simulations

seed

an integer giving the seed for simulations

newdata

a 2-column matrix of x and y coordinates

...

extra arguments to pass to predict.deform()

Examples

Run this code

# \donttest{

# deformations
data(solar)
m0 <- deform(solar$x, solar$z, solar$n) 
# Gaussian process simulations based on fitted deformation model
simulate(m0)

# }

# one-dimensional expansion model with five simulations and specified locations
data(solar)
m1 <- expand(solar$x, solar$z, solar$n)
xvals <- seq(-123.3, -122.25, by = .05)
yvals <- seq(49, 49.4, by = .05)
xyvals <- expand.grid(xvals, yvals)
simulate(m1, 5, newdata = xyvals)

Run the code above in your browser using DataLab