Likelihood modification in Metropolis Hastings ratio for transformed parameter
Clash Royale CLAN TAG#URR8PPP
$begingroup$
I want to use MH to get samples from $p(theta mid y) approx p(y mid theta) p(theta)$. Let's assume $theta$ is heavily constrained and I transform $theta$ to $f(theta)$ so I can sample from an unconstrained space.
The new posterior becomes $p(f(theta) mid y) approx p(y mid f(theta) ) p(f(theta)) ,times, |det(J_f^-1(y)) |$. Note that I only changed the prior term (Pushforward measure) and left the likelihood term unchanged as it is a probability distribution on $y$, not on $theta$.
(1) My question now is: can I - in the Metropolis Hastings acceptance ratio - just evaluate
$$fracp(y mid theta^star) p(y mid theta) ,times, fracp(f(theta^star)) mid det J_f^-1( theta^star) mid p(f(theta)) mid det J_f^-1( theta ) mid $$
? This term makes me nervous, because I transformed theta, evaluate the pdf of the transformed prior, but then transform it back and evaluate the likelihood of the parameter in the original space. However, I cannot evaluate the first term of this equation:
$$fracp(y mid f(theta^star)) p(y mid f(theta)) ,times, fracp(f(theta^star)) leftlvert det J_f^-1( theta^star) rightrvert p(f(theta)) leftlvert det J_f^-1( theta ) rightrvert .$$
I could somehow reverse engineer this problem, i.e. define priors on $f(theta)$ and then map $f(theta)$ to $theta$. The Jacobian of the inverse transform then becomes the Jacobian of the transform of my original problem. That way I could evaluate all terms. However, I originally wanted to give some meaning to my priors for $theta$, not for some unconstrained $f(theta)$.
EDIT: Problem solved and clarified - thank you, I should have seen this myself! Please also see
linked stackexchange thread to this post for further
clarification.
sampling mcmc likelihood likelihood-ratio metropolis-hastings
$endgroup$
add a comment |
$begingroup$
I want to use MH to get samples from $p(theta mid y) approx p(y mid theta) p(theta)$. Let's assume $theta$ is heavily constrained and I transform $theta$ to $f(theta)$ so I can sample from an unconstrained space.
The new posterior becomes $p(f(theta) mid y) approx p(y mid f(theta) ) p(f(theta)) ,times, |det(J_f^-1(y)) |$. Note that I only changed the prior term (Pushforward measure) and left the likelihood term unchanged as it is a probability distribution on $y$, not on $theta$.
(1) My question now is: can I - in the Metropolis Hastings acceptance ratio - just evaluate
$$fracp(y mid theta^star) p(y mid theta) ,times, fracp(f(theta^star)) mid det J_f^-1( theta^star) mid p(f(theta)) mid det J_f^-1( theta ) mid $$
? This term makes me nervous, because I transformed theta, evaluate the pdf of the transformed prior, but then transform it back and evaluate the likelihood of the parameter in the original space. However, I cannot evaluate the first term of this equation:
$$fracp(y mid f(theta^star)) p(y mid f(theta)) ,times, fracp(f(theta^star)) leftlvert det J_f^-1( theta^star) rightrvert p(f(theta)) leftlvert det J_f^-1( theta ) rightrvert .$$
I could somehow reverse engineer this problem, i.e. define priors on $f(theta)$ and then map $f(theta)$ to $theta$. The Jacobian of the inverse transform then becomes the Jacobian of the transform of my original problem. That way I could evaluate all terms. However, I originally wanted to give some meaning to my priors for $theta$, not for some unconstrained $f(theta)$.
EDIT: Problem solved and clarified - thank you, I should have seen this myself! Please also see
linked stackexchange thread to this post for further
clarification.
sampling mcmc likelihood likelihood-ratio metropolis-hastings
$endgroup$
add a comment |
$begingroup$
I want to use MH to get samples from $p(theta mid y) approx p(y mid theta) p(theta)$. Let's assume $theta$ is heavily constrained and I transform $theta$ to $f(theta)$ so I can sample from an unconstrained space.
The new posterior becomes $p(f(theta) mid y) approx p(y mid f(theta) ) p(f(theta)) ,times, |det(J_f^-1(y)) |$. Note that I only changed the prior term (Pushforward measure) and left the likelihood term unchanged as it is a probability distribution on $y$, not on $theta$.
(1) My question now is: can I - in the Metropolis Hastings acceptance ratio - just evaluate
$$fracp(y mid theta^star) p(y mid theta) ,times, fracp(f(theta^star)) mid det J_f^-1( theta^star) mid p(f(theta)) mid det J_f^-1( theta ) mid $$
? This term makes me nervous, because I transformed theta, evaluate the pdf of the transformed prior, but then transform it back and evaluate the likelihood of the parameter in the original space. However, I cannot evaluate the first term of this equation:
$$fracp(y mid f(theta^star)) p(y mid f(theta)) ,times, fracp(f(theta^star)) leftlvert det J_f^-1( theta^star) rightrvert p(f(theta)) leftlvert det J_f^-1( theta ) rightrvert .$$
I could somehow reverse engineer this problem, i.e. define priors on $f(theta)$ and then map $f(theta)$ to $theta$. The Jacobian of the inverse transform then becomes the Jacobian of the transform of my original problem. That way I could evaluate all terms. However, I originally wanted to give some meaning to my priors for $theta$, not for some unconstrained $f(theta)$.
EDIT: Problem solved and clarified - thank you, I should have seen this myself! Please also see
linked stackexchange thread to this post for further
clarification.
sampling mcmc likelihood likelihood-ratio metropolis-hastings
$endgroup$
I want to use MH to get samples from $p(theta mid y) approx p(y mid theta) p(theta)$. Let's assume $theta$ is heavily constrained and I transform $theta$ to $f(theta)$ so I can sample from an unconstrained space.
The new posterior becomes $p(f(theta) mid y) approx p(y mid f(theta) ) p(f(theta)) ,times, |det(J_f^-1(y)) |$. Note that I only changed the prior term (Pushforward measure) and left the likelihood term unchanged as it is a probability distribution on $y$, not on $theta$.
(1) My question now is: can I - in the Metropolis Hastings acceptance ratio - just evaluate
$$fracp(y mid theta^star) p(y mid theta) ,times, fracp(f(theta^star)) mid det J_f^-1( theta^star) mid p(f(theta)) mid det J_f^-1( theta ) mid $$
? This term makes me nervous, because I transformed theta, evaluate the pdf of the transformed prior, but then transform it back and evaluate the likelihood of the parameter in the original space. However, I cannot evaluate the first term of this equation:
$$fracp(y mid f(theta^star)) p(y mid f(theta)) ,times, fracp(f(theta^star)) leftlvert det J_f^-1( theta^star) rightrvert p(f(theta)) leftlvert det J_f^-1( theta ) rightrvert .$$
I could somehow reverse engineer this problem, i.e. define priors on $f(theta)$ and then map $f(theta)$ to $theta$. The Jacobian of the inverse transform then becomes the Jacobian of the transform of my original problem. That way I could evaluate all terms. However, I originally wanted to give some meaning to my priors for $theta$, not for some unconstrained $f(theta)$.
EDIT: Problem solved and clarified - thank you, I should have seen this myself! Please also see
linked stackexchange thread to this post for further
clarification.
sampling mcmc likelihood likelihood-ratio metropolis-hastings
sampling mcmc likelihood likelihood-ratio metropolis-hastings
edited Feb 16 at 14:52
Xi'an
58.1k897360
58.1k897360
asked Feb 15 at 14:37
MrVengeanZeMrVengeanZe
537
537
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
You should notice that what you denote $p(y|f(theta))$ is actually the same as $p(y|theta)$ [if you overlook the terrible abuse of notations]. As you mention, changing the parameterisation does not modify the density of the random variable at the observed value $y$ and there is no Jacobian associated with that part.
With proper notations, if
beginalign*
theta &sim pi(theta)qquadqquad&textprior\
y|theta &sim f(y|theta)qquadqquad&textsampling\
xi &= h(theta) qquadqquad&textreparameterisation\
dfractextdthetatextdxi(xi) &= J(xi)qquadqquad&textJacobian\
y|xi &sim g(y|xi)qquadqquad&textreparameterised density\
xi^(t+1)|xi^(t) &sim q(xi^(t+1)|xi^(t)) qquadqquad&textproposal
endalign*
the Metropolis-Hastings ratio associated with the proposal $xi'sim q(xi'|xi)$ in the $xi$ parameterisation is
$$
underbracedfracpi(theta(xi'))J(xi')pi(theta(xi))J(xi)_textratio of priorstimes
underbracedfracf(yf(y_textlikelihood ratiotimes
underbracedfracxi')xi)_textproposal ratio
$$
which also writes as
$$dfracpi(h^-1(xi'))J(xi')pi(h^-1(xi))J(xi)times
dfracg(yg(ytimes
dfracxi')xi)
$$
$endgroup$
1
$begingroup$
Dear Xi'an, thank you for your answer! I will mark it as solved!
$endgroup$
– MrVengeanZe
Feb 15 at 16:12
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "65"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstats.stackexchange.com%2fquestions%2f392687%2flikelihood-modification-in-metropolis-hastings-ratio-for-transformed-parameter%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
You should notice that what you denote $p(y|f(theta))$ is actually the same as $p(y|theta)$ [if you overlook the terrible abuse of notations]. As you mention, changing the parameterisation does not modify the density of the random variable at the observed value $y$ and there is no Jacobian associated with that part.
With proper notations, if
beginalign*
theta &sim pi(theta)qquadqquad&textprior\
y|theta &sim f(y|theta)qquadqquad&textsampling\
xi &= h(theta) qquadqquad&textreparameterisation\
dfractextdthetatextdxi(xi) &= J(xi)qquadqquad&textJacobian\
y|xi &sim g(y|xi)qquadqquad&textreparameterised density\
xi^(t+1)|xi^(t) &sim q(xi^(t+1)|xi^(t)) qquadqquad&textproposal
endalign*
the Metropolis-Hastings ratio associated with the proposal $xi'sim q(xi'|xi)$ in the $xi$ parameterisation is
$$
underbracedfracpi(theta(xi'))J(xi')pi(theta(xi))J(xi)_textratio of priorstimes
underbracedfracf(yf(y_textlikelihood ratiotimes
underbracedfracxi')xi)_textproposal ratio
$$
which also writes as
$$dfracpi(h^-1(xi'))J(xi')pi(h^-1(xi))J(xi)times
dfracg(yg(ytimes
dfracxi')xi)
$$
$endgroup$
1
$begingroup$
Dear Xi'an, thank you for your answer! I will mark it as solved!
$endgroup$
– MrVengeanZe
Feb 15 at 16:12
add a comment |
$begingroup$
You should notice that what you denote $p(y|f(theta))$ is actually the same as $p(y|theta)$ [if you overlook the terrible abuse of notations]. As you mention, changing the parameterisation does not modify the density of the random variable at the observed value $y$ and there is no Jacobian associated with that part.
With proper notations, if
beginalign*
theta &sim pi(theta)qquadqquad&textprior\
y|theta &sim f(y|theta)qquadqquad&textsampling\
xi &= h(theta) qquadqquad&textreparameterisation\
dfractextdthetatextdxi(xi) &= J(xi)qquadqquad&textJacobian\
y|xi &sim g(y|xi)qquadqquad&textreparameterised density\
xi^(t+1)|xi^(t) &sim q(xi^(t+1)|xi^(t)) qquadqquad&textproposal
endalign*
the Metropolis-Hastings ratio associated with the proposal $xi'sim q(xi'|xi)$ in the $xi$ parameterisation is
$$
underbracedfracpi(theta(xi'))J(xi')pi(theta(xi))J(xi)_textratio of priorstimes
underbracedfracf(yf(y_textlikelihood ratiotimes
underbracedfracxi')xi)_textproposal ratio
$$
which also writes as
$$dfracpi(h^-1(xi'))J(xi')pi(h^-1(xi))J(xi)times
dfracg(yg(ytimes
dfracxi')xi)
$$
$endgroup$
1
$begingroup$
Dear Xi'an, thank you for your answer! I will mark it as solved!
$endgroup$
– MrVengeanZe
Feb 15 at 16:12
add a comment |
$begingroup$
You should notice that what you denote $p(y|f(theta))$ is actually the same as $p(y|theta)$ [if you overlook the terrible abuse of notations]. As you mention, changing the parameterisation does not modify the density of the random variable at the observed value $y$ and there is no Jacobian associated with that part.
With proper notations, if
beginalign*
theta &sim pi(theta)qquadqquad&textprior\
y|theta &sim f(y|theta)qquadqquad&textsampling\
xi &= h(theta) qquadqquad&textreparameterisation\
dfractextdthetatextdxi(xi) &= J(xi)qquadqquad&textJacobian\
y|xi &sim g(y|xi)qquadqquad&textreparameterised density\
xi^(t+1)|xi^(t) &sim q(xi^(t+1)|xi^(t)) qquadqquad&textproposal
endalign*
the Metropolis-Hastings ratio associated with the proposal $xi'sim q(xi'|xi)$ in the $xi$ parameterisation is
$$
underbracedfracpi(theta(xi'))J(xi')pi(theta(xi))J(xi)_textratio of priorstimes
underbracedfracf(yf(y_textlikelihood ratiotimes
underbracedfracxi')xi)_textproposal ratio
$$
which also writes as
$$dfracpi(h^-1(xi'))J(xi')pi(h^-1(xi))J(xi)times
dfracg(yg(ytimes
dfracxi')xi)
$$
$endgroup$
You should notice that what you denote $p(y|f(theta))$ is actually the same as $p(y|theta)$ [if you overlook the terrible abuse of notations]. As you mention, changing the parameterisation does not modify the density of the random variable at the observed value $y$ and there is no Jacobian associated with that part.
With proper notations, if
beginalign*
theta &sim pi(theta)qquadqquad&textprior\
y|theta &sim f(y|theta)qquadqquad&textsampling\
xi &= h(theta) qquadqquad&textreparameterisation\
dfractextdthetatextdxi(xi) &= J(xi)qquadqquad&textJacobian\
y|xi &sim g(y|xi)qquadqquad&textreparameterised density\
xi^(t+1)|xi^(t) &sim q(xi^(t+1)|xi^(t)) qquadqquad&textproposal
endalign*
the Metropolis-Hastings ratio associated with the proposal $xi'sim q(xi'|xi)$ in the $xi$ parameterisation is
$$
underbracedfracpi(theta(xi'))J(xi')pi(theta(xi))J(xi)_textratio of priorstimes
underbracedfracf(yf(y_textlikelihood ratiotimes
underbracedfracxi')xi)_textproposal ratio
$$
which also writes as
$$dfracpi(h^-1(xi'))J(xi')pi(h^-1(xi))J(xi)times
dfracg(yg(ytimes
dfracxi')xi)
$$
edited Feb 15 at 15:52
answered Feb 15 at 14:52
Xi'anXi'an
58.1k897360
58.1k897360
1
$begingroup$
Dear Xi'an, thank you for your answer! I will mark it as solved!
$endgroup$
– MrVengeanZe
Feb 15 at 16:12
add a comment |
1
$begingroup$
Dear Xi'an, thank you for your answer! I will mark it as solved!
$endgroup$
– MrVengeanZe
Feb 15 at 16:12
1
1
$begingroup$
Dear Xi'an, thank you for your answer! I will mark it as solved!
$endgroup$
– MrVengeanZe
Feb 15 at 16:12
$begingroup$
Dear Xi'an, thank you for your answer! I will mark it as solved!
$endgroup$
– MrVengeanZe
Feb 15 at 16:12
add a comment |
Thanks for contributing an answer to Cross Validated!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstats.stackexchange.com%2fquestions%2f392687%2flikelihood-modification-in-metropolis-hastings-ratio-for-transformed-parameter%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown