[R-sig-Geo] gwr.sel: Plot CV score with bandwidth

Roger Bivand Roger.Bivand at nhh.no
Tue Mar 20 20:19:59 CET 2012


On Tue, 20 Mar 2012, katharina pijnenburg wrote:

> Hi,
> I would like to plot the cv score for each bandwidth (up to 5000km in my
> example), like in Fotheringham et al., p. 60.
> I tried to manipulate the gwr.cv.f function, but I couldn't manage it.

library(spgwr)
data(columbus)
out <- capture.output(bw <- gwr.sel(crime ~ income + housing,
   data=columbus, coords=cbind(columbus$x, columbus$y)))
df <- read.table(textConnection(out), header=FALSE)
plot(V5 ~ V2, data=df[order(df$V2),], xlab="Bandwidth", ylab="CV score",
   type="l")

library(fortunes)
fortune("Yoda")

Roger


>
> Thank you very much foor your help!
> Best,
> Katharina
>
>
> --
> View this message in context: http://r-sig-geo.2731867.n2.nabble.com/gwr-sel-Plot-CV-score-with-bandwidth-tp7388982p7388982.html
> Sent from the R-sig-geo mailing list archive at Nabble.com.
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

-- 
Roger Bivand
Department of Economics, NHH Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no



More information about the R-sig-Geo mailing list