View source: R/plot_pssignal.R
plot.pssignal | R Documentation |
psSignal
Plotting function for signal regression P-spline smooth coefficients (using psSignal
with class pssignal
), with or
without standard error bands.
## S3 method for class 'pssignal'
plot(x, ..., se = 2, xlab = "", ylab = "", col = "black", lty = 1)
x |
the P-spline x, usually from |
... |
other parameters. |
se |
a scalar, e.g. |
xlab |
label for the x-axis, e.g. "my x" (quotes required). |
ylab |
label for the y-axis, e.g. "my y" (quotes required). |
col |
color. |
lty |
line type for plotting e.g. |
Plot |
a plot of the smooth P-spline signal coefficent vector, with or without standard error bands. |
Paul Eilers and Brian Marx
Marx, B.D. and Eilers, P.H.C. (1999). Generalized linear regression for sampled signals and curves: A P-spline approach. Technometrics, 41(1): 1-13.
Eilers, P.H.C. and Marx, B.D. (2021). Practical Smoothing, The Joys of P-splines. Cambridge University Press.
library(JOPS)
# Get the data
library(fds)
data(nirc)
iindex=nirc$x
X=nirc$y
sel= 50:650 #1200 <= x & x<= 2400
X=X[sel, ]
iindex=iindex[sel]
dX=diff(X)
diindex=iindex[-1]
y=as.vector(labc[1,1:40])
oout = 23
dX=t(dX[,-oout])
y=y[-oout]
fit2 = psSignal(y, dX, diindex, nseg = 25,lambda = 0.0001)
plot(fit2, se = 2, xlab = 'Coefficient Index', ylab= "ps Smooth Coeff")
title(main='25 B-spline segments with tuning=0.0001')
names(fit2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.