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

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to