Learn R Programming

psvmSDR (version 3.0.1)

plot.npsdr: Plot sufficient predictors from an npsdr object

Description

Creates diagnostic scatter plots of nonlinear sufficient predictors produced by npsdr(). The function visualizes the estimated transformed directions and optionally overlays a lowess smoothing curve for continuous responses.

Additional graphical arguments can be provided. These plots help assess nonlinear structure in the data and evaluate how effectively the kernel SDR method reduces dimensionality.

Usage

# S3 method for npsdr
plot(
  x,
  ...,
  d = 1,
  lowess = TRUE,
  col = NULL,
  line.col = "red",
  pch = 16,
  lwd = 1.2,
  xlab = NULL,
  ylab = NULL
)

Value

A scatter plot with sufficient predictors.

Arguments

x

object from npsdr()

...

additional graphical parameters for plot()

d

number of sufficient predictors to plot (default = 1)

lowess

draw a lowess curve for continuous responses (default = TRUE)

col

point color(s)

line.col

color for lowess smoothing line (default = "red")

pch

point character (default = 16)

lwd

line width for smoothing (default = 1.2)

xlab

x-axis label (default depends on predictor index)

ylab

y-axis label (default = "Y" for continuous)

Author

Jungmin Shin, c16267@gmail.com, Seung Jun Shin, sjshin@korea.ac.kr, Andreas Artemiou artemiou@uol.ac.cy

See Also

npsdr_x, npsdr

Examples

Run this code
# \donttest{
set.seed(1)
n <- 200;
p <- 5;
x <- matrix(rnorm(n*p, 0, 2), n, p)
y <-  x[,1]/(0.5 + (x[,2] + 1)^2) + 0.2*rnorm(n)
obj_kernel <- npsdr(x, y, plot=FALSE)
plot(obj_kernel, d = 1)
# }

Run the code above in your browser using DataLab