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。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。