Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculating highest density intervals requires multiple calls to calibrator #329

Closed
joeroe opened this issue Jan 31, 2024 · 1 comment
Closed

Comments

@joeroe
Copy link
Contributor

joeroe commented Jan 31, 2024

Because we only cache the probability distribution, TAQ, and TPQ on cal records for c14 calibrations. I don't want to add HDI to that, because it belongs to specifically to (posterior) radiocarbon distributions, not to probabilistic dates more generally. Also, the choice of threshold is arbitrary and it would be nice to allow the user to select different ones (pending #328).

One solution would be to calculate the HDI in Ruby, perhaps building on https://github.com/joeroe/ruby-radiocarbon/, which would also make some related issues with calibrator go away (#323, #327, https://github.com/xronos-ch/xronos.config/issues/6).

On the other hand, the only actual problem with this—apart from the inelegance—is the possible performance hit, and I'm not sure that's significant. This is Cpp code we're talking about.


Incidentally, I went down a rabbit hole of terminology and algorithms in looking for a solution for this for ruby-radiocarbon. These were particularly useful reading:

As I understand it, what archaeologists refer to as "sigma ranges" are more properly the highest density intervals, regions, or sets.

Sometimes a p for posterior sneaks in there, but I think that's not quite right because they can be extracted from any kind of probability density distribution; p for probability makes more sense, but seems redundant. Some say that an 'interval' should be reserved for a single continuous range, but that seems a bit arbitrary to me, and 'interval' is more intuitive when we're talking about time.

@joeroe
Copy link
Contributor Author

joeroe commented Jan 31, 2024

Actually I can think of some benefit of doing this outside calibrator:

  • We could apply it to things other than radiocarbon dates. Although would assume we have another type of date described by a non-parametric function for which the HDI would be useful, so it's pretty hypothetical.
  • We could experiment with different measures. Single HDI vs. multiple HDIs, for example. Or the easystats docs suggest that the 'shortest probability interval' is better (https://easystats.github.io/bayestestR/reference/spi.html)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant