You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apply [`generate_sample!`](@ref) to each cell of `cells` indexed by `indices`.
83
+
"""
39
84
functiongenerate_sample!(
40
85
cells::Vector{T},
41
86
indices,
@@ -79,7 +124,7 @@ end
79
124
rng=-1
80
125
)::SWG.SimpleWeightedGraph
81
126
82
-
Construct the weighted interaction graph ([King graph](https://en.wikipedia.org/wiki/King%27s_graph)) used in [`generate_sample_grid_prs`](@ref), to generate exact samples from [`AbstractSpatialPointProcess`](@ref)
127
+
Construct the weighted interaction graph ([King graph](https://en.wikipedia.org/wiki/King%27s_graph)) used in [`PRS.generate_sample_grid_prs`](@ref), to generate exact samples from [`PRS.AbstractSpatialPointProcess`](@ref)
83
128
84
129
The `pp.window` is divided into cells of length the interaction range `pp.r`.
85
130
Each cell represents a vertex of the interaction (king) graph and each edge carries a uniform random varialble.
@@ -111,6 +156,13 @@ function weighted_interaction_graph(
111
156
return g
112
157
end
113
158
159
+
"""
160
+
gibbs_interaction
161
+
162
+
Compute the pairwise Gibbs interaction for a [`PRS.AbstractPointProcess`](@ref) between two [`PRS.AbstractCellGridPRS`](@ref).
163
+
164
+
This is a subroutine of [`PRS.generate_sample_grid_prs`](@ref).
165
+
"""
114
166
function gibbs_interaction end
115
167
116
168
@docraw"""
@@ -162,9 +214,10 @@ end
162
214
Identify the set of events to be resampled as constructed by Algorithm 5 in [GuJeLi19](@cite) as part of the Partial Rejection Sampling (PRS) method.
163
215
Return the indices of the variables (here cells) involved in the corresponding events.
164
216
165
-
This function is used as a subroutine of the grid PRS methodology of [MoKr20](@cite), see [`generate_sample_grid_prs`](@ref)
217
+
This function is used as a subroutine of the grid PRS methodology of [MoKr20](@cite), see [`PRS.generate_sample_grid_prs`](@ref).
166
218
167
219
**Note**
220
+
168
221
If the event associated to the edge ``\{i,j\}`` of `g` is selected to be resampled, the uniform random variable encoded as the weight of the correspond edge is resampled (hence the "!")
169
222
"""
170
223
functionfind_cells_to_resample_indices!(
@@ -203,9 +256,9 @@ end
203
256
spp::AbstractSpatialPointProcess{T},
204
257
)::Vector{SpatialCellGridPRS{T}} where {T}
205
258
206
-
The `spp.window` ([`RectangleWindow`](@ref) or [`SquareWindow`](@ref)) is divided into [`SpatialCellGridPRS`](@ref) of length the interaction range `pp.r` following the construction of [MoKr20](@cite) in their grid Partial Rejection Sampling (grid PRS) methodology.
259
+
The `spp.window` ([`PRS.RectangleWindow`](@ref) or [`PRS.SquareWindow`](@ref)) is divided into [`PRS.SpatialCellGridPRS`](@ref) of length the interaction range `pp.r` following the construction of [MoKr20](@cite) in their grid Partial Rejection Sampling (grid PRS) methodology.
207
260
208
-
This function is used as a subroutine of [`generate_sample_grid_prs`](@ref)
261
+
This function is used as a subroutine of [`PRS.generate_sample_grid_prs`](@ref)
209
262
"""
210
263
functioninitialize_cells(
211
264
spp::AbstractSpatialPointProcess{T},
@@ -236,10 +289,10 @@ end
236
289
cell_j::SpatialCellGridPRS
237
290
) = false
238
291
239
-
Assume `cell_i` and `cell_j` are neighboring cells in the weighted interaction graph constructed by [`weighted_interaction_graph`](@ref) from `spp` and already identified in the set of variables to be resampled in [`generate_sample_grid_prs`](@ref)
292
+
Assume `cell_i` and `cell_j` are neighboring cells in the weighted interaction graph constructed by [`weighted_interaction_graph`](@ref) from `spp` and already identified in the set of variables to be resampled in [`PRS.generate_sample_grid_prs`](@ref)
240
293
Since the configuration of points in the corresponding cells and the uniform random variable associated to the event `\{i,j\}` are considered fixed, there is no degree of freedom to make the interaction between `cell_i` and `cell_j` possible.
241
294
242
-
This function is used as a subroutine of [`generate_sample_grid_prs`](@ref)
295
+
This function is used as a subroutine of [`PRS.generate_sample_grid_prs`](@ref)
243
296
"""
244
297
functionis_inner_interaction_possible(
245
298
spp::AbstractSpatialPointProcess,
@@ -259,7 +312,7 @@ end
259
312
Assume `cell_i` and `cell_j` are neighboring cells in the weighted interaction graph constructed by [`weighted_interaction_graph`](@ref) from `spp`.
260
313
Given the configuration of points in `cell_i`, check whether a realization of `spp` in `cell_j` can induce a bad event.
261
314
262
-
This function is used as a subroutine of [`generate_sample_grid_prs`](@ref)
315
+
This function is used as a subroutine of [`PRS.generate_sample_grid_prs`](@ref)
0 commit comments