[R-sig-Geo] calculating join count expectation and variance when edge effect are of interest?

Roger Bivand Roger.Bivand at nhh.no
Tue May 14 10:47:33 CEST 2013


On Mon, 13 May 2013, Seth Myers wrote:

> Question: Any suggestions on calculating the expectation and variance of BW
> joins on a raster/matrix where edge effects are not treated as a nuisance
> but rather are included in the calculation?

Interesting question! My feeling would be that your shortest route to a 
resolution is to use Monte Carlo simulation instead of analytical 
variances.

However, you may need to work out how to model the actual memory process 
over time, which would lead to a parametric bootstrap, or possibly a 
Bayesian model.

This feels somewhat like state-space modelling, where you are interested 
in the probability of a raster cell changing category, conditional on its 
neighbours' status and change history. There was a JSS special number on 
state space modelling recently (but I may be barking up the wrong tree!).

Hope this helps,

Roger

>
> Background:
>
> Let's say I have a raster (or matrix) that is NxN cells. The cells take on
> values of 0 or 1 (W or B).
>
> The outer edge of this raster (cell[ ,1] or cell [ ,N] or cell [1, ] or
> cell [N, ]) can be 0s or 1s.  Let's say for argument that the edge as
> defined is composed of all 1 values and this is known a prior and does not
> change.
>
> Now, the interior of the raster (all cells not part of edge) take on values
> of 0 or 1 with a certain probability(cell=1)=[whatever value is most
> appropriate in the context].
>
> I would like to know the expected value for 1-0 (or BW) joins over the
> entire NxN raster given that the edge is set and joins with the edges
> "count" toward the final tally of BW joins but the interior cells are 1s
> (or black) with a certain probability.  Also, I would like to know the
> variance of BW joins over the entire NxN raster given these same conditions.
>
> I am interested because the "edge" in this analysis represents a previous
> landscape and I would like to know what the future can hold given previous
> conditions (the "memory" or "hysteresis" of the landscape going into the
> future).
>
> I am flexible on whether free sampling or non-free sampling is assumed,
> with a guess that free sampling will be more tractable.  Also, for
> simplicity, I would stick with rook case joins and only first neighbors
> (directly adjacent cells).
>
> I have searched for a function that computes join counts while taking into
> account edge effects, but have come up empty handed.
>
> I have looked at how expectations of BW joins and the variances are
> computed, and I believe another day of work will result in code where I can
> get the expectation under free sampling while taking into account the edge.
> That is because the expectation calculation is rather straightforward.
> However, I do not understand the variance calculation well enough to know
> how to proceed on it.
>
> Any input is appreciated.
>
> Seth Myers
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

-- 
Roger Bivand
Department of Economics, NHH Norwegian School of Economics,
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



More information about the R-sig-Geo mailing list