How to estimate kernel bandwidth function with cross-validation gwrr package The 2019 Stack...

Would it be possible to rearrange a dragon's flight muscle to somewhat circumvent the square-cube law?

Is this wall load bearing? Blueprints and photos attached

Am I ethically obligated to go into work on an off day if the reason is sudden?

Why use ultrasound for medical imaging?

Single author papers against my advisor's will?

Did the new image of black hole confirm the general theory of relativity?

Does the AirPods case need to be around while listening via an iOS Device?

Semisimplicity of the category of coherent sheaves?

Would an alien lifeform be able to achieve space travel if lacking in vision?

Is above average number of years spent on PhD considered a red flag in future academia or industry positions?

Why did all the guest students take carriages to the Yule Ball?

Did the UK government pay "millions and millions of dollars" to try to snag Julian Assange?

What was the last x86 CPU that did not have the x87 floating-point unit built in?

Match Roman Numerals

Are my PIs rude or am I just being too sensitive?

First use of “packing” as in carrying a gun

Derivation tree not rendering

How can I protect witches in combat who wear limited clothing?

Was credit for the black hole image misattributed?

What are these Gizmos at Izaña Atmospheric Research Center in Spain?

How are presidential pardons supposed to be used?

What do you call a plan that's an alternative plan in case your initial plan fails?

Make it rain characters

Difference between "generating set" and free product?



How to estimate kernel bandwidth function with cross-validation gwrr package



The 2019 Stack Overflow Developer Survey Results Are In
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Mosaic large dataset with RUnable to find an inherited method for function ‘writeRaster’ for signature ‘“SpatialGridDataFrame”, “character”’Handling multiple-extent-problem to create raster stack in R?Unable to writeRaster for signature “rasterPCA”, “character”Error while combining multiple partially overlapping rasters into a single raster in RIs their an equivalent of SpChFIDS for a spatial POINTS data frame?how to loop ndvi using R in sentinel-2calculation with raster and numeric values in Loop with RDisaggregating list of rasters in R?spTransform error (unable to find inherited method for function spTransform)





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















I am relatively new to R. I am attempting to use the gwrr package because I suspect that local collinearity may be an issue in my geographic weighted regression model.



If I am not mistaken, I first estimate the kernel bandwidth function using cross-validation. Below please find my R script. Diab is a spatial data set projected in Albers Equal Area Conic.



tt<-gwr.bw.est(dia2013~pctblacks + pcthis + pctpov+ lcollege+ newden+hosden10 +optden13 + totmdden13 + phyden13 + den13  +  nurseden13 + nohealthin + unemploy + transport, data=diab, kernel = "gauss", cv.tol=30)


However, I get the following error:



Error in (function (classes, fdef, mtable)  : 


unable to find an inherited method for function ‘geometry’ for signature ‘"numeric"’



Does anyone know what is going on?










share|improve this question
















bumped to the homepage by Community 13 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.






















    0















    I am relatively new to R. I am attempting to use the gwrr package because I suspect that local collinearity may be an issue in my geographic weighted regression model.



    If I am not mistaken, I first estimate the kernel bandwidth function using cross-validation. Below please find my R script. Diab is a spatial data set projected in Albers Equal Area Conic.



    tt<-gwr.bw.est(dia2013~pctblacks + pcthis + pctpov+ lcollege+ newden+hosden10 +optden13 + totmdden13 + phyden13 + den13  +  nurseden13 + nohealthin + unemploy + transport, data=diab, kernel = "gauss", cv.tol=30)


    However, I get the following error:



    Error in (function (classes, fdef, mtable)  : 


    unable to find an inherited method for function ‘geometry’ for signature ‘"numeric"’



    Does anyone know what is going on?










    share|improve this question
















    bumped to the homepage by Community 13 mins ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      0












      0








      0








      I am relatively new to R. I am attempting to use the gwrr package because I suspect that local collinearity may be an issue in my geographic weighted regression model.



      If I am not mistaken, I first estimate the kernel bandwidth function using cross-validation. Below please find my R script. Diab is a spatial data set projected in Albers Equal Area Conic.



      tt<-gwr.bw.est(dia2013~pctblacks + pcthis + pctpov+ lcollege+ newden+hosden10 +optden13 + totmdden13 + phyden13 + den13  +  nurseden13 + nohealthin + unemploy + transport, data=diab, kernel = "gauss", cv.tol=30)


      However, I get the following error:



      Error in (function (classes, fdef, mtable)  : 


      unable to find an inherited method for function ‘geometry’ for signature ‘"numeric"’



      Does anyone know what is going on?










      share|improve this question
















      I am relatively new to R. I am attempting to use the gwrr package because I suspect that local collinearity may be an issue in my geographic weighted regression model.



      If I am not mistaken, I first estimate the kernel bandwidth function using cross-validation. Below please find my R script. Diab is a spatial data set projected in Albers Equal Area Conic.



      tt<-gwr.bw.est(dia2013~pctblacks + pcthis + pctpov+ lcollege+ newden+hosden10 +optden13 + totmdden13 + phyden13 + den13  +  nurseden13 + nohealthin + unemploy + transport, data=diab, kernel = "gauss", cv.tol=30)


      However, I get the following error:



      Error in (function (classes, fdef, mtable)  : 


      unable to find an inherited method for function ‘geometry’ for signature ‘"numeric"’



      Does anyone know what is going on?







      r geographically-weighted-regression






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jul 1 '18 at 4:11









      Stefan

      1,460218




      1,460218










      asked Nov 8 '17 at 21:25









      Smky29Smky29

      11




      11





      bumped to the homepage by Community 13 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 13 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          1 Answer
          1






          active

          oldest

          votes


















          0














          The issue is that you haven't actually specified the coordinates to perform the function.



          In the vignette example found below. They had the data parameter set to a variable 'columbus' then they set the locs paramter to



          c(columbus$x,columbus$y). 


          https://cran.r-project.org/web/packages/gwrr/gwrr.pdf



          I'm not sure how your data is set out but you would need to change it to something like this



           tt<-gwr.bw.est(dia2013~pctblacks + pcthis + pctpov+ lcollege+ newden+hosden10 +optden13 + totmdden13 + phyden13 + den13 + nurseden13 + nohealthin + unemploy + transport, locs = c(diab$X,diab$Y) data=diab, kernel = "gauss", cv.tol=30)


          You would just need to change the X and Y to whatever your coordinate labels are in your data frame.






          share|improve this answer
























          • Thank you for your response. My object is of a spatial polygon class. I read in a shapefile using package rgdal. How do I extract the x and y coordinates to work with this formula?

            – Smky29
            Nov 8 '17 at 23:51











          • I just figured this part out, but I still have the error! #Fetch coordinates cordy<-coordinates(diab) #Add coordinates to data frame newz<-cbind(diab, cordy) locs <- cbind(newz$X1, newz$X2) tt<-gwr.bw.est(dia2013~pctblacks + pcthis + pctpov+ lcollege+ newden+hosden10 +optden13 + totmdden13 + phyden13 + den13 + nurseden13 + nohealthin + unemploy + transport, locs, data=newz, kernel = "gauss", cv.tol=30)

            – Smky29
            Nov 9 '17 at 1:17













          • With polygon data, your ariel units are non-uniform and as such, violate assumptions of the spatial model. In evaluating autocorrelation on lattice data one defines Wij as Nth-order neighbor contingency and not distance. Since you cannot account for contingency in the spatial relationships nor correct for variable polygon size, the resulting GWR model will be biased if not outright erroneous.

            – Jeffrey Evans
            Jun 30 '18 at 23:46














          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "79"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f261165%2fhow-to-estimate-kernel-bandwidth-function-with-cross-validation-gwrr-package%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          The issue is that you haven't actually specified the coordinates to perform the function.



          In the vignette example found below. They had the data parameter set to a variable 'columbus' then they set the locs paramter to



          c(columbus$x,columbus$y). 


          https://cran.r-project.org/web/packages/gwrr/gwrr.pdf



          I'm not sure how your data is set out but you would need to change it to something like this



           tt<-gwr.bw.est(dia2013~pctblacks + pcthis + pctpov+ lcollege+ newden+hosden10 +optden13 + totmdden13 + phyden13 + den13 + nurseden13 + nohealthin + unemploy + transport, locs = c(diab$X,diab$Y) data=diab, kernel = "gauss", cv.tol=30)


          You would just need to change the X and Y to whatever your coordinate labels are in your data frame.






          share|improve this answer
























          • Thank you for your response. My object is of a spatial polygon class. I read in a shapefile using package rgdal. How do I extract the x and y coordinates to work with this formula?

            – Smky29
            Nov 8 '17 at 23:51











          • I just figured this part out, but I still have the error! #Fetch coordinates cordy<-coordinates(diab) #Add coordinates to data frame newz<-cbind(diab, cordy) locs <- cbind(newz$X1, newz$X2) tt<-gwr.bw.est(dia2013~pctblacks + pcthis + pctpov+ lcollege+ newden+hosden10 +optden13 + totmdden13 + phyden13 + den13 + nurseden13 + nohealthin + unemploy + transport, locs, data=newz, kernel = "gauss", cv.tol=30)

            – Smky29
            Nov 9 '17 at 1:17













          • With polygon data, your ariel units are non-uniform and as such, violate assumptions of the spatial model. In evaluating autocorrelation on lattice data one defines Wij as Nth-order neighbor contingency and not distance. Since you cannot account for contingency in the spatial relationships nor correct for variable polygon size, the resulting GWR model will be biased if not outright erroneous.

            – Jeffrey Evans
            Jun 30 '18 at 23:46


















          0














          The issue is that you haven't actually specified the coordinates to perform the function.



          In the vignette example found below. They had the data parameter set to a variable 'columbus' then they set the locs paramter to



          c(columbus$x,columbus$y). 


          https://cran.r-project.org/web/packages/gwrr/gwrr.pdf



          I'm not sure how your data is set out but you would need to change it to something like this



           tt<-gwr.bw.est(dia2013~pctblacks + pcthis + pctpov+ lcollege+ newden+hosden10 +optden13 + totmdden13 + phyden13 + den13 + nurseden13 + nohealthin + unemploy + transport, locs = c(diab$X,diab$Y) data=diab, kernel = "gauss", cv.tol=30)


          You would just need to change the X and Y to whatever your coordinate labels are in your data frame.






          share|improve this answer
























          • Thank you for your response. My object is of a spatial polygon class. I read in a shapefile using package rgdal. How do I extract the x and y coordinates to work with this formula?

            – Smky29
            Nov 8 '17 at 23:51











          • I just figured this part out, but I still have the error! #Fetch coordinates cordy<-coordinates(diab) #Add coordinates to data frame newz<-cbind(diab, cordy) locs <- cbind(newz$X1, newz$X2) tt<-gwr.bw.est(dia2013~pctblacks + pcthis + pctpov+ lcollege+ newden+hosden10 +optden13 + totmdden13 + phyden13 + den13 + nurseden13 + nohealthin + unemploy + transport, locs, data=newz, kernel = "gauss", cv.tol=30)

            – Smky29
            Nov 9 '17 at 1:17













          • With polygon data, your ariel units are non-uniform and as such, violate assumptions of the spatial model. In evaluating autocorrelation on lattice data one defines Wij as Nth-order neighbor contingency and not distance. Since you cannot account for contingency in the spatial relationships nor correct for variable polygon size, the resulting GWR model will be biased if not outright erroneous.

            – Jeffrey Evans
            Jun 30 '18 at 23:46
















          0












          0








          0







          The issue is that you haven't actually specified the coordinates to perform the function.



          In the vignette example found below. They had the data parameter set to a variable 'columbus' then they set the locs paramter to



          c(columbus$x,columbus$y). 


          https://cran.r-project.org/web/packages/gwrr/gwrr.pdf



          I'm not sure how your data is set out but you would need to change it to something like this



           tt<-gwr.bw.est(dia2013~pctblacks + pcthis + pctpov+ lcollege+ newden+hosden10 +optden13 + totmdden13 + phyden13 + den13 + nurseden13 + nohealthin + unemploy + transport, locs = c(diab$X,diab$Y) data=diab, kernel = "gauss", cv.tol=30)


          You would just need to change the X and Y to whatever your coordinate labels are in your data frame.






          share|improve this answer













          The issue is that you haven't actually specified the coordinates to perform the function.



          In the vignette example found below. They had the data parameter set to a variable 'columbus' then they set the locs paramter to



          c(columbus$x,columbus$y). 


          https://cran.r-project.org/web/packages/gwrr/gwrr.pdf



          I'm not sure how your data is set out but you would need to change it to something like this



           tt<-gwr.bw.est(dia2013~pctblacks + pcthis + pctpov+ lcollege+ newden+hosden10 +optden13 + totmdden13 + phyden13 + den13 + nurseden13 + nohealthin + unemploy + transport, locs = c(diab$X,diab$Y) data=diab, kernel = "gauss", cv.tol=30)


          You would just need to change the X and Y to whatever your coordinate labels are in your data frame.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 8 '17 at 21:42









          Liam GLiam G

          1,55858




          1,55858













          • Thank you for your response. My object is of a spatial polygon class. I read in a shapefile using package rgdal. How do I extract the x and y coordinates to work with this formula?

            – Smky29
            Nov 8 '17 at 23:51











          • I just figured this part out, but I still have the error! #Fetch coordinates cordy<-coordinates(diab) #Add coordinates to data frame newz<-cbind(diab, cordy) locs <- cbind(newz$X1, newz$X2) tt<-gwr.bw.est(dia2013~pctblacks + pcthis + pctpov+ lcollege+ newden+hosden10 +optden13 + totmdden13 + phyden13 + den13 + nurseden13 + nohealthin + unemploy + transport, locs, data=newz, kernel = "gauss", cv.tol=30)

            – Smky29
            Nov 9 '17 at 1:17













          • With polygon data, your ariel units are non-uniform and as such, violate assumptions of the spatial model. In evaluating autocorrelation on lattice data one defines Wij as Nth-order neighbor contingency and not distance. Since you cannot account for contingency in the spatial relationships nor correct for variable polygon size, the resulting GWR model will be biased if not outright erroneous.

            – Jeffrey Evans
            Jun 30 '18 at 23:46





















          • Thank you for your response. My object is of a spatial polygon class. I read in a shapefile using package rgdal. How do I extract the x and y coordinates to work with this formula?

            – Smky29
            Nov 8 '17 at 23:51











          • I just figured this part out, but I still have the error! #Fetch coordinates cordy<-coordinates(diab) #Add coordinates to data frame newz<-cbind(diab, cordy) locs <- cbind(newz$X1, newz$X2) tt<-gwr.bw.est(dia2013~pctblacks + pcthis + pctpov+ lcollege+ newden+hosden10 +optden13 + totmdden13 + phyden13 + den13 + nurseden13 + nohealthin + unemploy + transport, locs, data=newz, kernel = "gauss", cv.tol=30)

            – Smky29
            Nov 9 '17 at 1:17













          • With polygon data, your ariel units are non-uniform and as such, violate assumptions of the spatial model. In evaluating autocorrelation on lattice data one defines Wij as Nth-order neighbor contingency and not distance. Since you cannot account for contingency in the spatial relationships nor correct for variable polygon size, the resulting GWR model will be biased if not outright erroneous.

            – Jeffrey Evans
            Jun 30 '18 at 23:46



















          Thank you for your response. My object is of a spatial polygon class. I read in a shapefile using package rgdal. How do I extract the x and y coordinates to work with this formula?

          – Smky29
          Nov 8 '17 at 23:51





          Thank you for your response. My object is of a spatial polygon class. I read in a shapefile using package rgdal. How do I extract the x and y coordinates to work with this formula?

          – Smky29
          Nov 8 '17 at 23:51













          I just figured this part out, but I still have the error! #Fetch coordinates cordy<-coordinates(diab) #Add coordinates to data frame newz<-cbind(diab, cordy) locs <- cbind(newz$X1, newz$X2) tt<-gwr.bw.est(dia2013~pctblacks + pcthis + pctpov+ lcollege+ newden+hosden10 +optden13 + totmdden13 + phyden13 + den13 + nurseden13 + nohealthin + unemploy + transport, locs, data=newz, kernel = "gauss", cv.tol=30)

          – Smky29
          Nov 9 '17 at 1:17







          I just figured this part out, but I still have the error! #Fetch coordinates cordy<-coordinates(diab) #Add coordinates to data frame newz<-cbind(diab, cordy) locs <- cbind(newz$X1, newz$X2) tt<-gwr.bw.est(dia2013~pctblacks + pcthis + pctpov+ lcollege+ newden+hosden10 +optden13 + totmdden13 + phyden13 + den13 + nurseden13 + nohealthin + unemploy + transport, locs, data=newz, kernel = "gauss", cv.tol=30)

          – Smky29
          Nov 9 '17 at 1:17















          With polygon data, your ariel units are non-uniform and as such, violate assumptions of the spatial model. In evaluating autocorrelation on lattice data one defines Wij as Nth-order neighbor contingency and not distance. Since you cannot account for contingency in the spatial relationships nor correct for variable polygon size, the resulting GWR model will be biased if not outright erroneous.

          – Jeffrey Evans
          Jun 30 '18 at 23:46







          With polygon data, your ariel units are non-uniform and as such, violate assumptions of the spatial model. In evaluating autocorrelation on lattice data one defines Wij as Nth-order neighbor contingency and not distance. Since you cannot account for contingency in the spatial relationships nor correct for variable polygon size, the resulting GWR model will be biased if not outright erroneous.

          – Jeffrey Evans
          Jun 30 '18 at 23:46




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Geographic Information Systems Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f261165%2fhow-to-estimate-kernel-bandwidth-function-with-cross-validation-gwrr-package%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          (145452) 2005 RN43 Классификация | Примечания | Ссылки |...

          Щит и меч (фильм) Содержание Названия серий | Сюжет |...

          Энтрерриос (город) Содержание История | Географическое...