[R-sig-Geo] A surface of GWR predicted values

bi@bi@iu m@iii@g oii whu@edu@c@ bi@bi@iu m@iii@g oii whu@edu@c@
Tue Nov 12 16:18:54 CET 2019


Dear Fred,

It seems that you were using the gwr.predict from the GWmodel package.




Note that the condition of outputing predictions at specific locations is that observations of the corresponding exploratory variables are available.

The predictions are output when you use the following routine:

gwr_test <- gwr.predict(job_density_log~distances+pop_density_log,data=zonas_OD_P_sp,kernel="gaussian",bw=21720)

because you were predicting the observations.

When you specified a point grid, NA were returned. I assumed that you didn't have any observed exploratory variables at them, and that's why. Note that GWR is not an interpolation technique. 




Hope it helps.

Cheers,

Binbin








> -----原始邮件-----
> 发件人: "Roger Bivand" <Roger.Bivand using nhh.no>
> 发送时间: 2019-11-12 20:59:17 (星期二)
> 收件人: "Fred Ramos" <fred.r.ramos using gmail.com>
> 抄送: "r-sig-geo using r-project.org" <r-sig-geo using r-project.org>
> 主题: Re: [R-sig-Geo] A surface of GWR predicted values
> 
> Please do not post HTML, only plain text.
> 
> You do need to say which package gwr.predict() comes from. Better, provide 
> a reproducible example with a built-in data set showing your problem.
> 
> Roger
> 
> On Tue, 12 Nov 2019, Fred Ramos wrote:
> 
> > Dear all,
> >
> > I`m trying to build a surface with predicted values using gwr.predict.
> >
> > When I run the gwr.predict without giving the fitting point it runs without problems. But when I enter with SpatialPointsDataFrame (a point grid) as fitting points the prediction values returns NA. Is there anything that I could do to get these results in the fitting points?
> >
> >
> >> gwr_test <- gwr.predict(job_density_log~distances+pop_density_log,data=zonas_OD_P_sp,kernel="gaussian",bw=21720)
> >
> >> gwr_test$SDF
> > class       : SpatialPointsDataFrame
> > features    : 423
> > extent      : 292782, 414055.3, 7349266, 7424404  (xmin, xmax, ymin, ymax)
> > crs         : +proj=utm +zone=23 +south +ellps=intl +units=m +no_defs
> > variables   : 5
> > names       :     Intercept_coef,        distances_coef, pop_density_log_coef,        prediction,    prediction_var
> > min values  : -0.958964210431336, -0.000128871984509238,    0.287006700717343, -3.26862056578432,  0.48618073025782
> > max values  :   4.17712723602899,  -1.8499577687439e-06,    0.979959974621219,  5.64311734285255, 0.693583031013022
> >
> >> gwr_out_grid_test <- gwr.predict(job_density_log~distances+pop_density_log,data=zonas_OD_P_sp,predictdata=grade_g_DF,kernel="gaussian",bw=21720)
> >
> >
> >> gwr_out_grid_test$SDF
> > class       : SpatialPointsDataFrame
> > features    : 9075
> > extent      : 293282, 413282, 7349904, 7423904  (xmin, xmax, ymin, ymax)
> > crs         : +proj=utm +zone=23 +south +ellps=intl +units=m +no_defs
> > variables   : 5
> > names       :    Intercept_coef,        distances_coef, pop_density_log_coef, prediction, prediction_var
> > min values  : -1.18701861474003, -0.000127242449368378,    0.310710138723114,         NA,             NA
> > max values  :  4.04479455484814,  2.02812418949068e-06,    0.995539141570355,         NA,             NA
> >
> > Many thanks,
> > Fred.
> >
> >
> >
> >
> > Sent from Mail for Windows 10
> >
> >
> >  [[alternative HTML version deleted]]
> >
> > _______________________________________________
> > R-sig-Geo mailing list
> > R-sig-Geo using r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> >
> 
> -- 
> Roger Bivand
> Department of Economics, Norwegian School of Economics,
> Helleveien 30, N-5045 Bergen, Norway.
> voice: +47 55 95 93 55; e-mail: Roger.Bivand using nhh.no
> https://orcid.org/0000-0003-2392-6140
> https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo



	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list