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

Roger Bivand Roger@B|v@nd @end|ng |rom nhh@no
Tue Nov 12 13:59:17 CET 2019


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



More information about the R-sig-Geo mailing list