Skip to content

Commit 7b1560c

Browse files
committed
Check number pairs CV
1 parent d9bf3ba commit 7b1560c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

R/n_pairs_opt.R

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
n_pairs_opt <- function(coord,values,n_min=12,n_max=20)
2+
{
3+
v <- rep(0,(n_max-n_min+1))
4+
n <- 1
5+
for (i in n_min:n_max)
6+
{
7+
CV <- crossvariogram(coord,values,i)
8+
aux <- CV[[1]][,3]
9+
v[n] <- max(aux)-min(aux)
10+
n <- n+1
11+
}
12+
best_ap <- which.min(v)
13+
list(dif_pairs=v,best=best_ap+n_min-1)
14+
}

0 commit comments

Comments
 (0)