Dear Sjoerd,
as stated in the title, I want to perform uncertainty quantification for an ACF that I calculate dependent on some lag time dt. The ACF f(dt) is implicitly given by
where A and B are educated estimations of time independent parameters (i.e. noise and amplitude estimates of a continuous signal) and d(dt) is some quantity that is calculated for said discrete lag times dt; these are the input parameters. Let's say for now that these parameters are independent of each other and normally distributed. Further, I have some prior knowledge about f(dt), namely that it should be (normally) distributed within the closed interval [0,1] (same goes for A and B).
As a first step, in order to estimate the associated uncertainty of the ACF, I did Gaussian propagation of uncertainty obtaining df(dt). Now it might happen that within the frequentist uncertainty margins, this prior knowledge is violated and I am having trouble reasoning putting a hard constraint on it.
That's why I thought this would be a great use case of Bayesian statistics. However, I am not quite sure how to implement it properly within this excellent pacelet.
My initial idea was to perform the nested sampling for each dt step as follows (please also see the notebook attached, where I provide example data and the full code.)
Table[nestedSampling[
defineInferenceProblem["Data" -> {d[[i]]},
"GeneratingDistribution" ->
NormalDistribution[ai*(1 - fi) + bi, dd[[i]]],
"Parameters" -> {{fi, 0, 1}, {ai, 0, 1}, {bi, 0, 1}},
"PriorDistribution" -> {NormalDistribution[f[[i]], df[[i]]],
NormalDistribution[A, dA], NormalDistribution[B, dB]}],
"SamplePoolSize" -> 1000,
"MonteCarloSteps" -> 1000,
"TerminationFraction" -> 0.01,
"MinIterations" -> 10], {i, Length@dt}];
where I input the values of f(dt) and df(dt) from previous calculations and the Gaussian uncertainty propagation, respectively.
Here I am not sure, whether it would be possible to do the analysis with the full list of d, instead of employing Table and with that, the calculations could be sped up a bit, since for a full data analysis I would need to run this procedure ~50 times.
I then get the new median and .68 quantiles by
Table[Around[#[[2]], {#[[2]] - #[[1]], #[[3]] - #[[2]]}] &@
Quantile[EmpiricalDistribution[
Values@fs[[i]]["Samples", All, "Point"][[All, 1]]], {1 - 0.68,
0.5, 0.68}], {i, Length@combdts}]
The values I get in the end seem plausible to me, though I am unsure whether this approach is actually suited for this problem. Intuitively it makes sense to me, but maybe I am missing something crucial.
Thanks in advance!
UCP_Bayesian.nb.zip
Dear Sjoerd,
as stated in the title, I want to perform uncertainty quantification for an ACF that I calculate dependent on some lag time
dt. The ACFf(dt)is implicitly given bywhere
AandBare educated estimations of time independent parameters (i.e. noise and amplitude estimates of a continuous signal) andd(dt)is some quantity that is calculated for said discrete lag timesdt; these are the input parameters. Let's say for now that these parameters are independent of each other and normally distributed. Further, I have some prior knowledge aboutf(dt), namely that it should be (normally) distributed within the closed interval[0,1](same goes forAandB).As a first step, in order to estimate the associated uncertainty of the ACF, I did Gaussian propagation of uncertainty obtaining
df(dt). Now it might happen that within the frequentist uncertainty margins, this prior knowledge is violated and I am having trouble reasoning putting a hard constraint on it.That's why I thought this would be a great use case of Bayesian statistics. However, I am not quite sure how to implement it properly within this excellent pacelet.
My initial idea was to perform the nested sampling for each
dtstep as follows (please also see the notebook attached, where I provide example data and the full code.)where I input the values of
f(dt)anddf(dt)from previous calculations and the Gaussian uncertainty propagation, respectively.Here I am not sure, whether it would be possible to do the analysis with the full list of
d, instead of employingTableand with that, the calculations could be sped up a bit, since for a full data analysis I would need to run this procedure ~50 times.I then get the new median and .68 quantiles by
The values I get in the end seem plausible to me, though I am unsure whether this approach is actually suited for this problem. Intuitively it makes sense to me, but maybe I am missing something crucial.
Thanks in advance!
UCP_Bayesian.nb.zip