predict.pspline(SpatialExtremes)
predict.pspline()所属R语言包:SpatialExtremes
Prediction of smoothing spline with radial basis functions
样条函数与径向基函数预测
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This function predicts the response from a fitted smoothing spline.
从装样条函数预测的响应。
用法----------Usage----------
## S3 method for class 'pspline'
predict(object, new.data, ...)
参数----------Arguments----------
参数:object
An object of class “pspline”. Most often, it will be the output of the function rbpspline.
对象的类“pspline”。大多数情况下,这将是功能rbpspline的输出。
参数:new.data
An optional data frame in which to look for variables with which to predict. If omitted, the fitted values are used.
一个可选的数据框中寻找变量,用以预测。如果省略该参数,拟合值。
参数:...
further arguments passed to or from other methods.
进一步的参数传递给其他方法。
值----------Value----------
'predict.pspline' produces a vector of predictions or a matrix of predictions.
predict.pspline产生一个预测的矢量或矩阵的预测。
(作者)----------Author(s)----------
Mathieu Ribatet
参见----------See Also----------
predict
predict
实例----------Examples----------
## 1- Define a function to approximate[#1 - 定义一个函数来近似]
fun <- function(x)
sin(3 * pi * x)
## 2- Compute the response from fun - and adding a noise[#2 - 乐趣 - 计算响应和添加噪音]
x <- seq(0, 1, length = 200)
y <- fun(x) + rnorm(200, 0, sqrt(0.4))
## 2- Fit a penalized smoothing spline[#2 - 适合被处罚的平滑样条曲线]
n.knots <- 30
knots <- quantile(x, prob = 1:n.knots / (n.knots + 2))
fitted <- rbpspline(y, x, knots, degree = 3)
## 3- Prediction from the fitted spline[#3 - 预测的拟合样条曲线]
plot(x, y, pch = 2, col = "red")
plot(fun, from = 0, to = 1, add = TRUE)
pred <- predict(fitted)
lines(pred[,1], pred[,2], col = "blue", pch = 3)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|