对于R的'stats'包的LOWESS回归线的置信区间(CI),我没有找到任何令人满意的答案:
plot(cars, main = "lowess(cars)")
lines(lowess(cars), col = 2)
Run Code Online (Sandbox Code Playgroud)
但是我不确定如何在它周围画出95%的CI?但是,我知道我可以得到估计的方差
V = s^2*sum(w^2)
Run Code Online (Sandbox Code Playgroud)
其中,s2 =估计误差方差,w =应用于X的权重.因此,95%CI应该是
Y plus/minus 2*sqrt(V(Y))
Run Code Online (Sandbox Code Playgroud)
我知道有一种方法可以让CI不受黄土影响,但我更喜欢LOWESS,因为它非常强大.谢谢你的建议.
我正在尝试使用'sp'包函数'over'通过多边形提取点
library(sp)
library(rgeos)
#my polygon plgn (many polygon features in one)
plot(plgn)
proj4string(plgn) = CRS("+proj=utm +zone=46 +datum=WGS84 +units=m +no_defs")
#giving spatial reference to point data d
coordinates(d) <- ~X+Y
proj4string(d) = CRS("+proj=utm +zone=46 +datum=WGS84 +units=m +no_defs")
#USE overlay (there are many NAs)
overlay=d[!is.na(over(d, plgn)),]
Run Code Online (Sandbox Code Playgroud)
不幸的是,我收到一个错误
Error in d[!is.na(over(d, plgn)), ] :
matrix argument not supported in SpatialPointsDataFrame selection
Run Code Online (Sandbox Code Playgroud)
任何的想法??是因为我的多边形包含100多个要素吗?
我的空格行为'list':
> SL1
[[1]]
class : SpatialLines
nfeatures : 1
extent : 253641, 268641, 2621722, 2621722 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=utm +zone=46 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0
[[2]]
class : SpatialLines
nfeatures : 1
extent : 253641, 268641, 2622722, 2622722 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=utm +zone=46 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0
[[3]]
class : SpatialLines
nfeatures : 1
extent : 253641, 268641, 2623722, 2623722 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=utm +zone=46 +datum=WGS84 …Run Code Online (Sandbox Code Playgroud) 我正在使用旧的 Fortran 脚本(可在此处访问)。我收到以下警告(第 192 行、第 233-235 行)。有办法解决吗?我在 Mac 上使用gfortran 6 。
Ms-MacBook-Pro-2:~ Tonoy$ gfortran -g -fcheck=all -Wall mrtm.f
mrtm.f:192:8:
N=COL/DX
1
Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion]
mrtm.f:233:10:
NKK=TPRINT/DT+0.50D0
1
Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion]
mrtm.f:234:10:
KLM=TTOTAL/DT+0.50D0
1
Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion]
mrtm.f:235:9:
KK=KLM/NKK+0.5D0
1
Warning: Possible change of value …Run Code Online (Sandbox Code Playgroud)