Skip to content

Missing local R-squared and residuals in gwr output

10 messages · Maximilian Sproß, "Sproß, Johann", Roger Bivand

#
On Fri, 4 May 2012, Maximilian Spro? wrote:

            
The understanding for use on a cluster was that the data points and the 
fit points are different, so there is no observed dependent variable at 
the fit point, hence no local R2. I've added logic in the code that checks 
for equality between the fit and data points, and this for me resolves the 
problem, but may break other things. I've committed to R-forge, project 
rspatial, module spgwr. The source tarball and binary packages should be 
available later this evening European time from:

https://r-forge.r-project.org/R/?group_id=1014

Could you please try it out, and report back? I should also migrate spgwr 
from snow to parallel before I release it.

Best wishes,

Roger

  
    
1 day later
#
On Mon, 7 May 2012, Maximilian Spro? wrote:

            
Correct. I'll try to add back an option to use snow instead of parallel. 
When it reaches R-forge, its revision number will be > 1252.

Roger

  
    
#
On Mon, 7 May 2012, "Spro?, Johann" wrote:

            
Add use_snow=TRUE to the command to switch to snow.

Roger

  
    
1 day later
#
Thank you Roger! The gwr on the MPI cluster works fine.

However, now the output object includes the intially missing three data 
slots: "gwr.e","pred" and "localR2". Unfortunately, the latter contains 
only NA's.
Sorry for of any inconvenience, but do you think you can solve that?

Thanks in advance and all the best,

Max
On 05/07/2012 08:45 PM, Roger Bivand wrote:
#
On Wed, 9 May 2012, Maximilian Spro? wrote:

            
I do not see any problem there, and indeed it is after the results have 
been returned from the cluster. You can tell whether you have been into 
the code block starting on line 261 in spgwr/R/gwr.R if there is no line 
beginning with "postprocess_localR2" in the timings component of the 
output object. The conditions are:

((!fp.given || fit_are_data) && is.null(fittedGWRobject))

where the first is FALSE, the second TRUE and the third TRUE in your case. 
If the "pred" column in your output contains values that are not finite, 
this may happen in this code block.

If you cannot see what is going on, we need a smaller test data set that 
replicates the problem.

Roger

  
    
#
Dear Roger!

Your are right, there are no problems anymore. I did some some 
comparative tests with a small subset of the dataset. The number of 
values in the "pred" column, which are not finite depends on the 
bandwidth. With increasing bandwidth, the NA's disappear.

Unfortunately, I cannot compute gwr.sel due to the large data amount.

By the way, all problems are solved and the use of the cluster is a 
really nice feature to decrease processing time efficiently.

Thank you very much for your help!

Max
On 05/09/2012 01:19 PM, Roger Bivand wrote:
#
On Thu, 10 May 2012, Maximilian Spro? wrote:

            
Thanks for checking and reporting back. I'll release to CRAN shortly.

Best wishes,

Roger