interp1(signal)
interp1()所属R语言包:signal
Interpolation
插值
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Interpolation methods, including linear, spline, and cubic interpolation.
插值方法,包括线性,样条曲线,三次插值。
用法----------Usage----------
interp1(x, y, xi, method = c("linear", "nearest", "pchip", "cubic", "spline"),
extrap = NA, ...)
参数----------Arguments----------
参数:x,y
vectors giving the coordinates of the points to be interpolated. x is assumed to be strictly monotonic.
给予的点的坐标的向量要插补。 x被认为是严格单调。
参数:xi
points at which to interpolate.
点内插。
参数:method
one of "linear", "nearest", "pchip", "cubic", "spline".
"linear","nearest","pchip","cubic","spline"之一。
参数:extrap
if TRUE or 'extrap', then extrapolate values beyond the endpoints. If extrap is a number, replace values beyond the endpoints with that number (defaults to NA).
如果TRUE或'extrap',然后推断超出了端点的值。如果extrap是一个数字,取代端点的价值超过这个数字(默认为NA)。
参数:...
for method='spline', additional arguments passed to splinefun.
为method='spline',额外的参数传递给splinefun。
Details
详细信息----------Details----------
The following methods of interpolation are available:
下面的插值方法可供选择:
'nearest': return nearest neighbour
'nearest':返回最近的邻居
'linear': linear interpolation from nearest neighbours
'linear':线性内插最近的邻居
'pchip': piecewise cubic hermite interpolating polynomial
'pchip':分段三次Hermite插值多项式
'cubic': cubic interpolation from four nearest neighbours
'cubic':三次插值从四个最近的邻居
'spline': cubic spline interpolation–smooth first and second derivatives throughout the curve
'spline':三次样条插值光滑的第一和第二衍生物整个曲线
值----------Value----------
The interpolated signal, an array of length(xi).
的内插信号,一个数组length(xi)。
(作者)----------Author(s)----------
Original Octave version by Paul Kienzle
<a href="mailto:pkienzle@user.sf.net">pkienzle@user.sf.net</a>. Conversion to R by Tom Short.
参考文献----------References----------
参见----------See Also----------
approx, filter,
approx,filter,
实例----------Examples----------
xf <- seq(0, 11, length=500)
yf <- sin(2*pi*xf/5)
#xp <- c(0:1,3:10)[XP < - C(0:1,3:10)]
#yp <- sin(2*pi*xp/5)[YP - 罪(2 * PI * XP / 5)]
xp <- c(0:10)
yp <- sin(2*pi*xp/5)
extrap <- TRUE
lin <- interp1(xp, yp, xf, 'linear', extrap = extrap)
spl <- interp1(xp, yp, xf, 'spline', extrap = extrap)
pch <- interp1(xp, yp, xf, 'pchip', extrap = extrap)
cub <- interp1(xp, yp, xf, 'cubic', extrap = extrap)
near <- interp1(xp, yp, xf, 'nearest', extrap = extrap)
plot(xp, yp, xlim = c(0, 11))
lines(xf, lin, col = "red")
lines(xf, spl, col = "green")
lines(xf, pch, col = "orange")
lines(xf, cub, col = "blue")
lines(xf, near, col = "purple")
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|