[R-sig-Geo] help using SVC_mle of library varycoef

Emanuele Barca em@nue|e@b@rc@ @end|ng |rom b@@|r@@@cnr@|t
Sun Jul 23 12:33:48 CEST 2023


Hi, this is emanuele barca and I would like to learn the library 
varycoef.
I created a simulation of an ideal spatial dataset (gaussian) and 
applied SVC_mle function:

set.seed(1234)

library(gstat)

# create structure
nx <- 100
ny <- 100
xy <- expand.grid(1:nx, 1:ny)
names(xy) <- c("x","y")

g.dummy <- gstat(formula = z ~ 1 + x + I(y^0.5), locations = ~ x + y, 
dummy = T, beta = c(1, 0.01, 0.005),
                  model = vgm(psill = 0.025, range = 20, model = 'Ste', 
kappa = 10), nmax = 20)

yy <- predict(g.dummy, newdata = xy, nsim = 1)


xy.reduced <- as.data.frame(matrix(ncol = 3, nrow = 0))
for (i in 1:5000){
   xy.reduced[i, ] <- yy[i*2, 1:3]
}

Fact<- 20/100 #% of reduction about 80%
training <- sample(nrow(xy.reduced), trunc(Fact*nrow(xy.reduced)))
Xtraining <- xy.reduced[training, ]
Xtest <- xy.reduced[-training, ]
df_train <- Xtraining
colnames(df_train) <- c("X", "Y", "sim")

fit_svc <- SVC_mle(sim ~ X + Y, data = df_train, locs = df_train[, 
1:2])#
coef(fit_svc)
summary(fit_svc)

but it returns an error of the covariance matrix.
  Could someone help me to overcome the error?

thanks in advance

emanuele



More information about the R-sig-Geo mailing list