splineDesign(splines)
splineDesign()所属R语言包:splines
Design Matrix for B-splines
B样条的矩阵设计
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Evaluate the design matrix for the B-splines defined by knots at the values in x.
评估设计矩阵定义的B样条knots在x值。
用法----------Usage----------
splineDesign(knots, x, ord = 4, derivs, outer.ok = FALSE)
spline.des(knots, x, ord = 4, derivs, outer.ok = FALSE)
参数----------Arguments----------
参数:knots
a numeric vector of knot positions with non-decreasing values.
一个结位置值非递减的数字向量。
参数:x
a numeric vector of values at which to evaluate the B-spline functions or derivatives. Unless outer.ok is true, the values in x must be between knots[ord] and knots[ length(knots) + 1 - ord ].
一个价值评估B样条函数或衍生工具的数字向量。除非outer.ok是真实的,在x值必须介于knots[ord]和knots[ length(knots) + 1 - ord ]。
参数:ord
a positive integer giving the order of the spline function. This is the number of coefficients in each piecewise polynomial segment, thus a cubic spline has order 4. Defaults to 4.
一个正整数样条函数的顺序。这是在每个分段多项式部分系数的数量,因此,三次样条4阶。默认值为4。
参数:derivs
an integer vector of the same length as x and with values between 0 and ord - 1. The derivative of the given order is evaluated at the x positions. Defaults to a vector of zeroes of the same length as x.
x和0和ord - 1之间的值相同长度的整数向量。给定的顺序衍生x职位评估。默认为x相同长度的零向量。
参数:outer.ok
logical indicating if x should be allowed outside the inner knots, see the x argument.
逻辑表示x如果应允许外内结,看到x参数。
值----------Value----------
A matrix with length( x ) rows and length( knots ) - ord columns. The i'th row of the matrix contains the coefficients of the B-splines (or the indicated derivative of the B-splines) defined by the knot vector and evaluated at the i'th value of x. Each B-spline is defined by a set of ord successive knots so the total number of B-splines is length(knots)-ord.
length( x )行length( knots ) - ord列矩阵。矩阵的第i行包含B样条(或指定的衍生工具的B样条)knot向量和定义第i个在x的价值评估系数 。每个B样条的定义是一套ord连续海里,因此B样条的总数是length(knots)-ord。
注意----------Note----------
The older spline.des function takes the same arguments but returns a list with several components including knots, ord, derivs, and design. The design component is the same as the value of the splineDesign function.
老spline.des功能需要几个组件包括knots,ord,derivs,design相同的论点,但返回一个列表。 design组件作为splineDesign函数值相同。
作者(S)----------Author(s)----------
Douglas Bates and Bill Venables
举例----------Examples----------
require(graphics)
splineDesign(knots = 1:10, x = 4:7)
knots <- c(1,1.8,3:5,6.5,7,8.1,9.2,10)# 10 => 10-4 = 6 Basis splines[10 = 10-4 = 6基础样条]
x <- seq(min(knots)-1, max(knots)+1, length.out=501)
bb <- splineDesign(knots, x=x, outer.ok = TRUE)
plot(range(x), c(0,1), type="n", xlab="x", ylab="",
main= "B-splines - sum to 1 inside inner knots")
mtext(expression(B[j](x) *" and "* sum(B[j](x), j==1, 6)), adj=0)
abline(v=knots, lty=3, col="light gray")
abline(v=knots[c(4,length(knots)-3)], lty=3, col="gray10")
lines(x, rowSums(bb), col="gray", lwd=2)
matlines(x, bb, ylim = c(0,1), lty=1)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|