tag:blogger.com,1999:blog-4113082053753185517.post273634676605749490..comments2023-07-02T13:50:28.495+02:00Comments on Samuel Bosch: Creating a kernel density estimate map in RSamuel Boschhttp://www.blogger.com/profile/00902576471871535529noreply@blogger.comBlogger10125tag:blogger.com,1999:blog-4113082053753185517.post-5400329280783773272018-12-03T08:24:26.730+01:002018-12-03T08:24:26.730+01:00x = est$x1 is the x-coordinate or longitude, y = e...x = est$x1 is the x-coordinate or longitude, y = est$x2 is the y-coordinate or latitude and z = est$fhat is the density estimate at that location. So est.raster = raster(list(x=est$x1,y=est$x2,z=est$fhat)) will create a raster with as value the estimated density.Samuel Boschhttps://www.blogger.com/profile/00902576471871535529noreply@blogger.comtag:blogger.com,1999:blog-4113082053753185517.post-78697618619935450082018-12-03T05:54:21.283+01:002018-12-03T05:54:21.283+01:00hi, thank you for this blog, i found it useful for...hi, thank you for this blog, i found it useful for my analysis, but i dont understand about this coding, can u eloberate what is x=est$1, y=est$x2,z=est$fhat? from est.raster = raster(list(x=est$x1,y=est$x2,z=est$fhat)).Anonymoushttps://www.blogger.com/profile/10144366306533539809noreply@blogger.comtag:blogger.com,1999:blog-4113082053753185517.post-55842658597804837822018-04-16T11:41:57.914+02:002018-04-16T11:41:57.914+02:00Bandwidth determines how smooth your kernel densit...Bandwidth determines how smooth your kernel density map will be, see this Wikipedia article for more information on bandwith selection https://en.wikipedia.org/wiki/Kernel_density_estimation#Bandwidth_selection.<br />The gridsize determines the resolution of the raster grid (number of columns and rows).Samuel Boschhttps://www.blogger.com/profile/00902576471871535529noreply@blogger.comtag:blogger.com,1999:blog-4113082053753185517.post-64580693321716273842018-04-16T11:36:38.892+02:002018-04-16T11:36:38.892+02:00Hey,
thanks so much for this blog. I am trying t...Hey, <br /><br />thanks so much for this blog. I am trying to do the same for my data. Could you maybe elaborate on the choice of bandwidth and gridsize? I've been googling around trying to find a good explanation but haven't come across one unfortunately. <br /><br />Thanks so much!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4113082053753185517.post-39591329789746623382018-03-19T09:16:02.895+01:002018-03-19T09:16:02.895+01:00This examples expects that columns that the second...This examples expects that columns that the second and third columns have the x and y coordinates. So yes, 2 and 3 refer too the columns.<br /><br />Colors can be changed while plotting with the "col" parameter but if you want to create nicer maps I would advice to use something like QGIS.Samuel Boschhttps://www.blogger.com/profile/00902576471871535529noreply@blogger.comtag:blogger.com,1999:blog-4113082053753185517.post-60326546136463276872018-03-17T12:23:20.721+01:002018-03-17T12:23:20.721+01:00Hello ! Thanks for this tutorial. I am a beginner ...Hello ! Thanks for this tutorial. I am a beginner with R but I want to do exactly the same thing with my personal data. But R display error messages when I enter this:<br /><br />"records <- read.csv(input)<br />coordinates <- records[,2:3]"<br /><br />What is the signification of the number 2 and 3 ? The columns ?<br /><br />And is there a way to change the colors of the density map ? <br /><br />Thanks in advance ! Anonymoushttps://www.blogger.com/profile/06763204586621500260noreply@blogger.comtag:blogger.com,1999:blog-4113082053753185517.post-7258467553396866442014-05-26T09:57:24.119+02:002014-05-26T09:57:24.119+02:00I don't know how to do it in R but CrimeStat (...I don't know how to do it in R but CrimeStat (<a href="http://nij.gov/topics/technology/maps/Pages/crimestat.aspx" rel="nofollow">http://nij.gov/topics/technology/maps/Pages/crimestat.aspx</a>) has the necessary functionality. Just make sure to check the "Use weighting variable" checkbox. But take your time to explore the documentation because the CrimeStat UI its not very intuitive.Samuel Boschhttps://www.blogger.com/profile/00902576471871535529noreply@blogger.comtag:blogger.com,1999:blog-4113082053753185517.post-82480263235943256452014-05-24T19:01:10.470+02:002014-05-24T19:01:10.470+02:00Any idea how to weight values in the bkde2D functi...Any idea how to weight values in the bkde2D function or another similar function?Nate Wesselhttps://www.blogger.com/profile/17337597383480299344noreply@blogger.comtag:blogger.com,1999:blog-4113082053753185517.post-51262357499178307272014-02-25T17:31:04.576+01:002014-02-25T17:31:04.576+01:00Thanks for your comment! I didn't find a spher...Thanks for your comment! I didn't find a spherical kernel smoothing function in R.Samuel Boschhttps://www.blogger.com/profile/00902576471871535529noreply@blogger.comtag:blogger.com,1999:blog-4113082053753185517.post-61016096031866119302014-02-25T09:16:25.736+01:002014-02-25T09:16:25.736+01:00You're using lat-long in a 2d kernel smoother....You're using lat-long in a 2d kernel smoother. Your kernels are, especially at 50N, more like ellipses. I'm not sure if there is a spherical kernel smoothing function in R, but if you want to smooth global data, you need it!Anonymoushttps://www.blogger.com/profile/03263677417814151768noreply@blogger.com