Skip to content

Commit

Permalink
Check number pairs CV
Browse files Browse the repository at this point in the history
  • Loading branch information
victorvicpal committed Jan 30, 2017
1 parent d9bf3ba commit 7b1560c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions R/n_pairs_opt.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
n_pairs_opt <- function(coord,values,n_min=12,n_max=20)
{
v <- rep(0,(n_max-n_min+1))
n <- 1
for (i in n_min:n_max)
{
CV <- crossvariogram(coord,values,i)
aux <- CV[[1]][,3]
v[n] <- max(aux)-min(aux)
n <- n+1
}
best_ap <- which.min(v)
list(dif_pairs=v,best=best_ap+n_min-1)
}

0 comments on commit 7b1560c

Please sign in to comment.