Skip to content

Commit f664081

Browse files
committed
minor edits to overview
1 parent 67070f1 commit f664081

File tree

1 file changed

+9
-31
lines changed

1 file changed

+9
-31
lines changed

docs/src/gen/overview.md

Lines changed: 9 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
# Gen.jl and CompetingClocks.jl
22

3-
This is my new package to sample discrete event samplers. I want to use it with the Julia Gen.jl package. I know there are ways to do statistical methods that use likelihood calculations, and I want to do those calculations using the CompetingClocks.jl package. Please give me a first overview of the ways my package can interact with Gen.jl.
4-
5-
From Gen’s point of view, there are two main “hooks” your package can plug into:
3+
From [Gen's](https://www.gen.dev/) point of view, there are two main “hooks” CompetingClocks.jl can plug into:
64

75
1. probability distributions (`Distribution{T}` with `random`/`logpdf`), and
86
2. generative functions (things that implement the Generative Function Interface and produce traces with scores). ([Gen][1])
97

10-
CompetingClocks already provides exactly the operations those need: forward simulation of event paths, and step‑ or path‑wise log‑likelihoods.
8+
CompetingClocks already the operations Gen needs: forward simulation of event paths, and step‑ or path‑wise log‑likelihoods.
119

1210
Below is an overview of the main integration modes.
1311

@@ -63,7 +61,6 @@ If you want finer control over the trace (addressable choices per event, increme
6361

6462
### Core idea
6563

66-
Your integration guide already frames CompetingClocks as “event timing and scheduling” inside a larger simulation loop.
6764
Gen’s generative function should:
6865

6966
* take simulation parameters and possibly a time horizon as arguments,
@@ -121,7 +118,7 @@ The clean way to plug this into Gen is still via a custom distribution or genera
121118

122119
### b) Importance sampling and mixture proposals
123120

124-
Your importance‑sampling chapter already treats path log‑likelihoods under multiple distributions, using `likelihood_cnt` and `PathLikelihoods` to compute weights (and mixture proposals via `logsumexp`).
121+
We have already seen [importance sampling](../gene_expression.md) with CompetingClocks.
125122

126123
Within Gen:
127124

@@ -136,8 +133,6 @@ This lets you reuse your variance‑reduction machinery (common random numbers,
136133

137134
### c) HMC/gradient‑based parameter inference
138135

139-
Your HMC chapter shows using an event list and `pathloglikelihood` as the log‑density for HMC over event times.
140-
141136
Two ways this interacts with Gen:
142137

143138
1. **External HMC over latent event times**, Gen for everything else
@@ -152,25 +147,6 @@ Two ways this interacts with Gen:
152147

153148
---
154149

155-
## 4. Addressing and key types
156-
157-
Your integration guide already calls out that clock keys can be
158-
159-
* tuples like `(:infect, infectious, susceptible)`,
160-
* integers, or
161-
* `:i => 37`, “a Pair for use with Gen.jl.”
162-
163-
That last choice is a natural way to share an addressing scheme:
164-
165-
* use the same `Pair` or tuple as both
166-
167-
* the CompetingClocks clock key, and
168-
* the Gen address for the corresponding random choice.
169-
170-
Then trace choice maps from Gen and your own logs of event keys line up one‑for‑one.
171-
172-
---
173-
174150
## Summary
175151

176152
At a high level, the main interaction patterns are:
@@ -181,7 +157,9 @@ At a high level, the main interaction patterns are:
181157

182158
All three rely on the same core feature set you already built: configurable samplers/contexts, step‑ and path‑wise log‑likelihoods, watchers, and importance‑sampling tools.
183159

184-
[1]: https://www.gen.dev/docs/stable/ref/modeling/distributions/ "Probability Distributions · Gen.jl"
185-
[2]: https://www.gen.dev/docs/stable/how_to/custom_gen_fns/ "Adding New Generative Functions · Gen.jl"
186-
[3]: https://www.gen.dev/docs/stable/ref/core/gfi/ "Generative Function Interface · Gen.jl"
187-
[4]: https://www.gen.dev/docs/dev/how_to/custom_distributions/ "Adding New Distributions · Gen.jl"
160+
## References
161+
162+
1. https://www.gen.dev/docs/stable/ref/modeling/distributions/ "Probability Distributions · Gen.jl"
163+
2. https://www.gen.dev/docs/stable/how_to/custom_gen_fns/ "Adding New Generative Functions · Gen.jl"
164+
3. https://www.gen.dev/docs/stable/ref/core/gfi/ "Generative Function Interface · Gen.jl"
165+
4. https://www.gen.dev/docs/dev/how_to/custom_distributions/ "Adding New Distributions · Gen.jl"

0 commit comments

Comments
 (0)