Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9155587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:37:19+00:00 2026-06-17T12:37:19+00:00

I want to do a cross-validation for the ca20-Dataset from the geoR package. With

  • 0

I want to do a cross-validation for the ca20-Dataset from the geoR
package. With for example the meuse-dataset, this works fine, but for
this dataset, I encounter a strange problem with the dimensions of the
SpatialPointsDataFrame. Maybe you can try this for yourself and explain
why the autoKrige.cv function does not work (I tried several
nfold-values but this only changes the locations-value of the error
message…):

library(geoR)
library(gstat)
library(automap)
data(ca20)
east=ca20$coords[,1]
north=ca20$coords[,2]
concentration=ca20$data
frame=data.frame(east,north)
data=data.frame(concentration)
points<-SpatialPoints(data.frame(east,north),proj4string=CRS(as.character(NA)))
pointsframe<-SpatialPointsDataFrame(points,data, coords.nrs = numeric(0),proj4string = CRS(as.character(NA)), match.ID = TRUE)
krig=autoKrige(pointsframe$concentration~1,pointsframe)
plot(krig)
cv=autoKrige.cv(pointsframe$concentration~1,pointsframe)

I hope someone can reproduce the problem, my R version is 2.15, all packages are up to date (at least not older than a month or so…).

Thanks for your help!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T12:37:20+00:00Added an answer on June 17, 2026 at 12:37 pm

    First, the way you build your SpatialPointsDataFrame can be done more easily:

    library(geoR)
    library(gstat)
    library(automap)
    

    …and build the SPDF:

    pointsframe = data.frame(ca20$coords)
    pointsframe$concentration = ca20$data
    coordinates(pointsframe) = c("east", "north")
    

    The problem you have is in how you use the formula argument. You add the spatial object pointsframe to the formula, in essence putting a vector directly into the formula. You should just use the column name in the formula, like this:

    cv=autoKrige.cv(concentration~1,pointsframe)
    

    and it works:

    > summary(cv)
                [,1]      
    mean_error  -0.01134  
    me_mean     -0.0002237
    MAE         6.02      
    MSE         60.87     
    MSNE        1.076     
    cor_obspred 0.7081    
    cor_predres 0.01343   
    RMSE        7.802     
    RMSE_sd     0.7041    
    URMSE       7.802     
    iqr         9.519 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to display image after textbox for validation (tick and cross) But when
I want to generate drop shadows. But it is difficult to generate cross platform
I have cross-tab and i want put second cross-tab to right side, but i
Apologies for cross posting (I asked this on the Silverlight Forum but got no
I want to run n fold cross validation on some classifiers I am using.
I have a project written in Lazarus on Windows, but I want to cross-compile
I've thought of a few ways of doing this but I want to get
I am using sql server 2008 and I want to cross tab this table
I want to cross join the two table Query Select * from table1 cross
I want to develop cross platform mobile app. I have seen frameworks listed below

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.