R語言
predict.bSpline
位於 splines
包(package)。 說明
從虛擬類 bSpline
和 polySpline
繼承的類的 predict
方法用於評估樣條線或其導數。樣條線對象的 plot
方法首先在缺少 x
參數的情況下計算 predict
,然後用 type = "l"
繪製生成的 xyVector
。
用法
## S3 method for class 'bSpline'
predict(object, x, nseg = 50, deriv = 0, ...)
## S3 method for class 'nbSpline'
predict(object, x, nseg = 50, deriv = 0, ...)
## S3 method for class 'pbSpline'
predict(object, x, nseg = 50, deriv = 0, ...)
## S3 method for class 'npolySpline'
predict(object, x, nseg = 50, deriv = 0, ...)
## S3 method for class 'ppolySpline'
predict(object, x, nseg = 50, deriv = 0, ...)
參數
object |
從 |
x |
用於評估樣條線的 |
nseg |
一個正整數,給出跨越 |
deriv |
0 到 |
... |
傳入或傳出其他方法的進一步參數。 |
值
帶有組件的xyVector
x |
提供或推斷的 |
y |
|
例子
require(graphics); require(stats)
ispl <- interpSpline( weight ~ height, women )
opar <- par(mfrow = c(2, 2), las = 1)
plot(predict(ispl, nseg = 201), # plots over the range of the knots
main = "Original data with interpolating spline", type = "l",
xlab = "height", ylab = "weight")
points(women$height, women$weight, col = 4)
plot(predict(ispl, nseg = 201, deriv = 1),
main = "First derivative of interpolating spline", type = "l",
xlab = "height", ylab = "weight")
plot(predict(ispl, nseg = 201, deriv = 2),
main = "Second derivative of interpolating spline", type = "l",
xlab = "height", ylab = "weight")
plot(predict(ispl, nseg = 401, deriv = 3),
main = "Third derivative of interpolating spline", type = "l",
xlab = "height", ylab = "weight")
par(opar)
作者
Douglas Bates and Bill Venables
也可以看看
相關用法
- R predict.bs 評估樣條基礎
- R polySpline 分段多項式樣條表示
- R periodicSpline 創建周期性插值樣條線
- R xyVector 構造一個 xyVector 對象
- R backSpline 單調逆樣條
- R bs 多項式樣條的 B 樣條基礎
- R splineDesign B 樣條的設計矩陣
- R asVector 將對象強製為向量
- R interpSpline 創建插值樣條線
- R splineOrder 確定樣條線的階數
- R ns 生成自然三次樣條的基礎矩陣
- R splineKnots 來自樣條線的結向量
- R SparkR spark.decisionTree用法及代碼示例
- R variogram 計算空間變異函數
- R SparkR sparkR.callJMethod用法及代碼示例
- R SparkR spark.powerIterationClustering用法及代碼示例
- R SparkR spark.svmLinear用法及代碼示例
- R anova.trls 用於擬合趨勢表麵對象的方差分析表
- R SparkR spark.gaussianMixture用法及代碼示例
- R SparkR sparkR.newJObject用法及代碼示例
- R Kfn 計算點模式的 K-fn
- R SparkR spark.naiveBayes用法及代碼示例
- R Kenvl 計算 K-fns 模擬的包絡和平均值
- R SparkR sparkR.version用法及代碼示例
- R SparkR spark.getSparkFiles用法及代碼示例
注:本文由純淨天空篩選整理自R-devel大神的英文原創作品 Evaluate a Spline at New Values of x。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。