Skip to content

The sum.w Field in SDF

3 messages · Ryan Rosario, Roger Bivand, Andrew Niccolai

#
On Wed, 18 Jul 2007, Ryan Rosario wrote:

            
This is apparently a follow-up to a question on 15 July about robust GWR. 
GWR is seriously affected by multicollinearity anyway (see Wheeler & 
Tiefelsdorf refered to on the gwr() help page), so trying this may be a 
waste of time.
It is simply the sum of weights for that fit point - with fixed bandwidth, 
the weights sums vary, so that is why it is reported.
No, you need to modify both gwr.sel() and gwr() to take a weights= 
argument like lm, and them multiply the geographical weights by the case 
weights for each fit point. Then you can use the formula you cite to 
construct case weights, but only for data points.

Note that you are mixing up data points and fit points - there are *no* 
residuals at fit points unless the fit points are data points. You can 
only try this trick if you force data and fit points to be the same (as 
when computing the hat matrix).

If you'd like to contribute patches for adding a weights= argument, I 
could look and see if they seem to work.

Roger

  
    
2 days later
#
Hello R-spatial group, I hope this email finds everyone well.  I have been
using the R package EBImage to convert .tif/.jpg images of forests into
watershed segmentation rasters.  However, I am having difficulty converting
these watershed images into polygons.  For those not familiar with EBImage
or watershed segmentation, the package essentially does an iterative series
of image erosion and dilating to try to create boundaries between objects
within an image that "bleed" into each other.  However, these images create
objects without any label values so within any image object resides several
similar but slightly different values encapsulated by an edge with much
lower (but slightly different) values.

I was wondering if anyone had any thoughts/suggestions for converting
IndexedImages to polygons?  I have an IndexedImage created using code along
these lines:

rgb <- abs(img.red - img.green)
#display(rgb)
rgb.u <- umask(rgb, r=11, s=5)
#display(rgb.u)

t <- thresh( blur(rgb.u, 4, 2), 15, 15)
t <- opening( closing(t, morphKern(9)) ) t <- erode(t,morphKern(9), iter=5)
#display(t)

w <- watershed( distmap(t) )
#display(normalize(w))
w2 <- getFeatures(w)

When I run getFeatures, I can see 362 rows in the array.  This corresponds
to what I assume are the number of objects in my watershed image.  However,
when I try to write out either w or normalize(w) I get either a binary image
(w) or an image with normalized values within each object and not a uniform
label id with each object.  Ideally, I would like to create an image with
362 objects with each object "filled" with a label value representing that
unique object.  Then I think I can convert the raster image to polygons
(although suggestions here are welcome as well).


Any help would be greatly appreciated.

Thank you,
Andrew 


Andrew Niccolai
Doctoral Candidate
Yale School of Forestry