Last updated: 2022-11-15

Checks: 2 0

Knit directory: gsmash/

This reproducible R Markdown analysis was created with workflowr (version 1.7.0). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.

The results in this page were generated with repository version 0d2dc7a. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    .Rhistory
    Ignored:    .Rproj.user/
    Ignored:    data/poisson_mean_simulation/

Untracked files:
    Untracked:  figure/
    Untracked:  output/poisson_mean_simulation/
    Untracked:  output/poisson_smooth_simulation/

Unstaged changes:
    Modified:   analysis/index.Rmd
    Modified:   analysis/normal_mean_penalty_glm_simplified.Rmd
    Modified:   code/poisson_mean/simulation_summary.R

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


These are the previous versions of the repository in which changes were made to the R Markdown (analysis/log_term_in_penalty.Rmd) and HTML (docs/log_term_in_penalty.html) files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view the files as they were in that past version.

File Version Author Date Message
Rmd 0d2dc7a DongyueXie 2022-11-15 wflow_publish("analysis/log_term_in_penalty.Rmd")

Introduction

There is a log term in the \(\rho_g(\theta)\):

\[\rho_g(\theta) = -l_{NM}(T(\theta,g);g,s^2(\theta))-\frac{(\theta-T(\theta;g))^2}{2s^2(\theta)}-\frac{1}{2}\log 2\pi s^2(\theta).\]

We have shown that if we include \(-\frac{1}{2}\log 2\pi s^2(\theta)\) in the \(\rho_g(\theta)\), then \(\rho_g(\theta)\) is not really a penalty term, or at least not one that penalize the posterior mean towards prior mean. See with and without the log term in the Poisson case for comparisons.

Why this is the case?

Because in our formulation, we took a second order Taylor series expansion of the log-likelihood around posterior mean. Then we put the quadratic term into the \(\rho_g(\theta)\). So at least there’s a part of \(\rho_g(\theta)\) that belongs to the log-likelihood. The log term is from evaluating \(KL(q||g)\) where \(q(b) = g*N(z;b,s^2)/c(z)\).

In normal case the log term in likelihood and the one in “penalty” cancels out so there’s no such log term in the objective function.

If we remove the log term from \(\rho_g(\theta)\) and call the new penalty as \(\tilde\rho_g(\theta)\) then the objective is

\[-l(\theta) - \frac{1}{2}\log s^2(\theta) + \tilde\rho_g(\theta).\]

We note that \(s^2(\theta)\) is the observed fisher information at \(\theta\) so the new objective can be regarded as penalized (log-likelihood and log-information)?