Skip to content

Commit

Permalink
minor improvements to counting events
Browse files Browse the repository at this point in the history
  • Loading branch information
Jachym.Barvinek committed Dec 11, 2024
1 parent 137fe02 commit 319dcb7
Show file tree
Hide file tree
Showing 9 changed files with 1,261 additions and 199 deletions.
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,3 +226,4 @@ jekyll-archives:
#category: /categories/:name/

future: true
excerpt_separator: "<!--more-->"
4 changes: 3 additions & 1 deletion _posts/2024-10-16-waiting-times.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: 'Waiting times'
layout: post
date: 2024-10-16
tags: [probability theory]
tags: [probability theory,time series]
pin: true
math: true
---
Expand Down Expand Up @@ -139,3 +139,5 @@ The notable solutions when this is possible to do analytically are summarized in

![](/assets/images/erlang_events.png "Sample waiting times from Erlang(6,2) distribution")
![](/assets/images/nb_events.png "Sample waiting times from NegativeBinomial(4,2/3) distribution")

Next read: [Counting events](/posts/counting-events/)
5 changes: 3 additions & 2 deletions _posts/2024-10-17-counting-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: 'Counting events'
layout: post
date: 2024-10-17
tags: [probability theory]
tags: [probability theory,time series]
pin: true
math: true
---
Expand Down Expand Up @@ -88,7 +88,7 @@ and here I show where the name comes from.

As a reminder, the density of the exponential distribution has a single parameter $\lambda$ and is given by:

$$p(t) = \lambda e^{-\lambda t}$$ for $t > 0$, otherwise $0$.
$$p(t) = \lambda e^{-\lambda t}, \; t > 0$$

Convolving this density with itself produces:

Expand Down Expand Up @@ -191,6 +191,7 @@ We derived the Poisson distribution as the count of events of a random process f
Obtaining the distribution of counts of events for other waiting time distributions is possible in principle, at least numerically,
but usually won't have a nice closed-form solution.

Next read: [Inhomogeneous Poisson process](/posts/inhomogeneous-poisson-process/)

## References
1. Renewal Theory, D.R.Cox, 1962, p. 37
5 changes: 3 additions & 2 deletions _posts/2024-12-04-inhomogeneous-poisson-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: 'Inhomogeneous Poisson process & case study'
layout: post
date: 2024-12-04
tags: [probability theory,statistics,case study]
tags: [probability theory,statistics,time series,case study]
pin: true
math: true
---
Expand Down Expand Up @@ -55,7 +55,7 @@ Fortunately, even one realization may be enough to reasonably learn,
if there are enough event records compared to the number of parameters.
The log-likelihood can be shown<sup>[1],[2]</sup> to be:

$$\mathcal{l}(\mathbf{t}|\mathbf{\theta}) = \sum_{i=1}^n \log \lambda(t_i|\mathbf{\theta}) - \int_0^T \lambda(s|\mathbf{\theta}) \mathrm{d}s$$
$$\mathscr{l}(\mathbf{t}|\mathbf{\theta}) = \sum_{i=1}^n \log \lambda(t_i|\mathbf{\theta}) - \int_0^T \lambda(s|\mathbf{\theta}) \mathrm{d}s$$

Intuitively, the sum accounts for the events that have occurred and the integral accounts for the events that did not occur, but could have.
For more complicated functions, the integral will likely not have an analytic solution
Expand Down Expand Up @@ -107,6 +107,7 @@ where we can use them to express arbitrary periodicities, which provides a natur
![](/assets/images/step_plot_sales_fit.png "Cumulative purchase counts with fit")


Next read: [Generalized linear models](/posts/glms/)


## References
Expand Down
153 changes: 123 additions & 30 deletions _posts/2024-12-07-glms.md

Large diffs are not rendered by default.

Binary file modified assets/images/linreg_ols_vs_mle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/normal_vs_poisson_glm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/normal_vs_poisson_glm_intervals.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,292 changes: 1,128 additions & 164 deletions assets/notebooks/glms.ipynb

Large diffs are not rendered by default.

0 comments on commit 319dcb7

Please sign in to comment.