简体   繁体   English

我如何在R中进行样条插值

[英]How I can do Spline Interpolation in R

I am a newbie in R and trying to do interpolation in R(sorry if it seems a lame question) . 我是R的新手,并尝试在R中进行插值(对不起,这很a脚)。 I have some Points(Lat,Lan and one integer value for each point) that I need to interpolate them. 我需要一些点(纬度,经度和每个点一个整数值)进行插值。 I am a GIS user I did it in ARCGIS but ArcGIS doesn't give me RMSE for spline as far as I know, so I thought to do in in R and learn some R. I have learned basif stuff such as plotting ,,,,, Can you please tell me step by step what I should do in R language to interpolate the points(global level) and calculate RMSE? 我是GIS用户,我在ARCGIS中做过,但就我所知,ArcGIS并没有给我RMSE作为样条线,所以我想在R中学习并学到一些R。我已经学到了一些基础知识,例如绘图、、、 ,,您能一步一步告诉我,我应该用R语言做什么来插值点(全局级别)并计算RMSE?

I really appreciate any help Hank 我非常感谢Hank的任何帮助

I would take a look at the Tps function from the fields package, where Tps stands for Thin plate spline. 我将从字段包中查看Tps函数,其中Tps代表薄板样条线。 Tps (from the documentation ): Tps(来自文档 ):

Fits a thin plate spline surface to irregularly spaced data. 使薄板样条曲线表面适合不规则间隔的数据。 The smoothing parameter is chosen by generalized cross-validation. 通过广义交叉验证来选择平滑参数。 The assumed model is additive Y = f(X) +e where f(X) is ad dimensional surface. 假定模型为加法Y = f(X)+ e,其中f(X)为广告尺寸表面。 This is a special case of the spatial process estimate. 这是空间过程估计的一种特殊情况。

See the documentation of Tps for some code examples. 有关某些代码示例,请参见Tps文档。

Have you got a reason for using splines (other than that's what you had in the software)? 您是否有使用样条线的理由(除了软件中的用途之外)? You should probably read http://cran.r-project.org/web/views/Spatial.html and consider a good book on Geostatistics http://spatial-analyst.net/book/ and then you might want to do the interpolation using Kriging. 您可能应该阅读http://cran.r-project.org/web/views/Spatial.html并考虑一本关于地统计学的好书http://spatial-analyst.net/book/ ,然后您可能想要使用克里金插值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM