View source: R/predict_support.R
predict.pssignal | R Documentation |
psSignal
Prediction function which returns both linear
predictor and inverse link predictions, for an arbitrary matrix of signals
(using psSignal
with class pssignal
).
## S3 method for class 'pssignal'
predict(object, ..., X_pred, type = "mu")
object |
an object using |
... |
other parameters. |
X_pred |
a matrix of arbitrary signals with |
type |
the mean value |
pred |
the estimated mean (inverse link function) (default)
or the linear predictor prediction with |
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]
fit1 = psSignal(y, dX, diindex, nseg = 25,lambda = 0.0001)
predict(fit1, X_pred = dX[1:5, ])
predict(fit1, X_pred = dX[1:5, ], type = 'eta')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.