lmoffatt / macro_dr

GNU General Public License v3.0
1 stars 1 forks source link

equilibrate the variance of the partial Evidence by altering the betas #215

Closed lmoffatt closed 3 months ago

lmoffatt commented 4 months ago

First lets find out the relationship between the variance of the partial Evidence and the betas:

first lets find an approximation for the contribution to the evidence between $\beta{i+1}$ and $\beta{i}$

E_i^{i+1} \approx \frac {1}{2} \cdot (\beta_{i+1}-\beta_{i}) \cdot (L_i +L_{i+1})

where L is the logLikelihood

lmoffatt commented 4 months ago
vE_i \approx \frac {1}{4} \cdot \Delta \beta_i^2 \cdot (vL_i +vL_{i+1})

where vL is the variance of the logLikelihood

lmoffatt commented 4 months ago

now the derivative is

\frac{\partial vE_i}{\partial \beta_{i}}  \approx  - \frac {1}{2} \cdot \Delta \beta_i \cdot (vL_i +vL_{i+1})
\frac{\partial vE_{i+1}}{\partial \beta_{i+1}}  \approx  \frac {1}{2} \cdot \Delta \beta_i \cdot (vL_i +vL_{i+1})
lmoffatt commented 4 months ago

now if we want to equilibrate the partial Evidences, we want to minimize the difference between succesive partial Evidences:

\Delta  vE_i \equiv vE_{i+1} - vE_{i} 

we want to bring $\Delta vE$ to zero. Using a first order Taylor

\Delta vE (\beta) = \Delta vE (\beta^0) + (\beta- \beta^0) \cdot \frac {\partial \Delta vE}{\partial \beta}

Then equating to zero we obtain $\beta$

\beta = \beta^0 - \frac {\Delta vE (\beta^0)}{\frac {\partial \Delta vE}{\partial \beta}} 
lmoffatt commented 4 months ago

the derivative of $\Delta vE$ is

\frac {\partial \Delta vE_i}{\partial \beta_{i+1}} \approx   \frac {1}{2} \cdot 
\left (\Delta \beta_{i+1} \cdot (vL_{i+1} +vL_{i+2}) +
\Delta \beta_{i} \cdot (vL_{i} +vL_{i+1}) 
\right)
lmoffatt commented 4 months ago

we can also express the variance in terms of $\Delta L$

\frac {\partial \Delta vE_i}{\partial \beta_{i+1}} \approx   \frac {1}{2} \cdot 
\left (
\Delta L_{i+1}
+
\Delta L_{i}
\right)
lmoffatt commented 4 months ago

we can also estimate the variance of the evidence in terms of logL instead of variance of logL:

vL_i = \frac {\partial L_i}{\partial \beta_i} \approx \frac {1}{2} \cdot \left (\frac {\Delta L_{i-1}}{\Delta \beta_{i-1}}  +\frac {\Delta L_{i}}{\Delta \beta_i}  \right)
lmoffatt commented 4 months ago
vE_i \approx \frac {1}{8}  \cdot  \left (\frac { \Delta \beta_i}{\Delta \beta_{i-1}} \cdot \Delta L_{i-1}   + 2 \cdot \Delta L_{i} +\frac { \Delta \beta_i}{\Delta \beta_{i+1}}   \cdot \Delta L_{i+1}  \right) \cdot \Delta \beta_i
lmoffatt commented 4 months ago
\frac{\partial vL_i}{\partial \beta_i}  \approx \frac {1}{2} \cdot 
\left (vL_{i} \cdot (
\frac {1}{\Delta \beta_{i-1}}  -\frac {1}{\Delta \beta_i}  )

-\frac {\Delta L_{i-1}}{\Delta \beta_{i-1}^2}  +\frac {\Delta L_{i}}{\Delta \beta_i^2}  

\right)
lmoffatt commented 4 months ago
vL_i\approx \frac {1}{2} \cdot \left (\frac {\Delta L_{i-1}}{\Delta \beta_{i-1}}  +\frac {\Delta L_{i}}{\Delta \beta_i}  \right)
\frac{\partial vL_i}{\partial \beta_i}  \approx \frac {1}{2} \cdot 
\left (vL_{i} \cdot (
\frac {1}{\Delta \beta_{i-1}}  -\frac {1}{\Delta \beta_i}  )

-\frac {\Delta L_{i-1}}{\Delta \beta_{i-1}^2}  +\frac {\Delta L_{i}}{\Delta \beta_i^2}  

\right)
\frac{\partial vL_i}{\partial \beta_i}  \approx \frac {1}{2} \cdot 
\left (
 \frac {1}{2} \cdot \left (\frac {\Delta L_{i-1}}{\Delta \beta_{i-1}}  +\frac {\Delta L_{i}}{\Delta \beta_i}  \right) \cdot (
\frac {1}{\Delta \beta_{i-1}}  -\frac {1}{\Delta \beta_i}  )

-\frac {\Delta L_{i-1}}{\Delta \beta_{i-1}^2}  +\frac {\Delta L_{i}}{\Delta \beta_i^2}  

\right)
lmoffatt commented 4 months ago
\frac{\partial vL_i}{\partial \beta_i}  \approx \frac {1}{4} \cdot 
\frac {\Delta L_{i}-\Delta L_{i-1}}{\Delta \beta_{i-1} \cdot  \Delta \beta_{i}}  
lmoffatt commented 3 months ago

The problem with this approach is that it is much slower than using Acceptance or synthetic Acceptance methods.