Extrapolation beyond a grid of data

后端 未结 1 1897
轮回少年
轮回少年 2021-01-27 14:16

I have a grid of (x, y, z) values and I want a function that can approximate z-values when it is given (x,y) points that lie beyond the grid.

I have tried to solve the q

1条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-27 15:00

    Got a result by using interp.old() directly:

    interp.old(xy[,1], xy[,2], zz, xo = c(0.7), yo= c(0.7, 1.2), ncp=2, extrap=TRUE)
    # = (0.9211469, 1.472434)
    

    I am not sure if this is a bug in the interp() function. interp() is a wrapper that calls interp.old() if linear=TRUE and interp.new() if linear=FALSE. The interp.new() function seems to fail.

    Note that the use of the ncp parameter is deprecated. From the manual:

    ncp - deprecated, use parameter linear. Now only used by interp.old(). meaning was: number of additional points to be used in computing partial derivatives at each data point. ncp must be either 0 (partial derivatives are not used), or at least 2 but smaller than the number of data points (and smaller than 25)

    0 讨论(0)
提交回复
热议问题