plot.ps2dnormal {JOPS}R Documentation

Plotting function for ps2DNormal

Description

Plotting function for 2D P-spline smooothing (using ps2DNormal with class ps2dnormal).

Usage

## S3 method for class 'ps2dnormal'
plot(x, ..., xlab = " ", ylab = " ", Resol = 100)

Arguments

x

the P-spline object, usually from ps2DNormal.

...

other parameters.

xlab

label for the x-axis, e.g. "my x" (quotes required).

ylab

label for the y-axis, e.g. "my y" (quotes required).

Resol

resolution for plotting, default Resol = 100.

Value

Plot

a plot of the smooth 2D P-spline smooth surface.

Author(s)

Paul Eilers and Brian Marx

References

Eilers, P.H.C. and Marx, B.D. (2021). Practical Smoothing, The Joys of P-splines. Cambridge University Press.

Eilers, P.H.C., Marx, B.D., and Durban, M. (2015). Twenty years of P-splines, SORT, 39(2): 149-186.

Examples

library(SemiPar)
library(fields)
library(spam)
library(JOPS)

# Get the data
data(ethanol)
x <- ethanol$C
y <- ethanol$E
z <- ethanol$NOx

# Set parameters for domain
xlo <- 7
xhi <- 19
ylo <- 0.5
yhi <- 1.25

# Set P-spline parameters, fit and compute surface
xpars <- c(xlo, xhi, 10, 3, 3, 1)
ypars <- c(ylo, yhi, 10, 3, 3, 1)
Pars1 <- rbind(xpars, ypars)
fit <- ps2DNormal(cbind(x, y, z), Pars = Pars1)
plot(fit, xlab = "C", ylab = "E")

[Package JOPS version 0.1.19 Index]