An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20070718/e52a4249/attachment.pl>
The sum.w Field in SDF
3 messages · Ryan Rosario, Roger Bivand, Andrew Niccolai
On Wed, 18 Jul 2007, Ryan Rosario wrote:
I understand that the sum.w field is the sum of the weights associated with a particular observation/location.
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.
But what is this sum taken over? Is there a way to access the individual weights before they are summed?
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.
Basically, I need a single weight for each observation (not a sum), so that I can use the robust GWR method presented by Brundsdon et. al. So I need to divide sum.w by some number N. This will give me an average weight (more importantly, it is a single weight). In this case, what does N represent? The number of observations, or is it some number of iterations for a numerical method used in GWR?
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
Ryan [[alternative HTML version deleted]]
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Roger Bivand Economic Geography Section, Department of Economics, Norwegian School of Economics and Business Administration, 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
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