marginal density of $|X|$
up vote
1
down vote
favorite
I have a continuous random variable $X$ whose distribution is conditioned on another discrete random variable $S$. The conditional density function of $X$ is
- $f_{X|S}(x|1) = alpha e^{-alpha x}, x geq 0$
- $f_{X|S}(x|-1) = beta e^{beta x}, x leq 0$
I can see that when $S=1$, $X sim Exp(alpha)$ with $alpha >0$ and when $S=-1$, $-X sim Exp(beta)$ with $beta >0$. That is, $S$ is the sign of $X$.
I then define $Z = |X|$ and I have to calculate $mathbb{P}(S=1|Z=z)$. I know that this is the posterior probability of $S$ and I can use the Bayes rule for the case of a discrete unknown and continuous observation. The chosen formula is:
$$p_{S|Z}(1|z)= frac{p_S(1)f_{Z|S}(z|1)}{f_Z(z)}$$
and I know from the prior of $S$ that $p_S(1) = p$.
My approach to calculate $f_{Z|S}(z|1)$ would be to consider that, if I know that $S=1$ therefore $Z = X$ and $f_{Z|S}(z|1) = f_{X|S}(x|1)$. What I don't understand is how to come out with the marginal of $Z$. The marginal of $X$ is:
$p cdot alpha e^{-alpha x}$ when $x geq 0$
$(1-p) cdot beta e^{beta x}$ when $x leq 0$
and my idea here is that the marginal of $Z$ is $p cdot alpha e^{-alpha z} + (1-p) cdot beta e^{beta z}$ since the $|X|$ mirrors $-X$ for the negative part, but I get a bit lost at this point.
EDIT: I also thought that, since $f_{X|S}(x|-1) = beta e^{beta x}$ then $f_{Z|S}(z|-1) = beta e^{-beta x}$, therefore
$$f_Z(z) = p cdot alpha e^{-alpha z} + (1-p) cdot beta e^{-beta z}$$
but I don't know whether this is correct.
probability-distributions bayes-theorem
add a comment |
up vote
1
down vote
favorite
I have a continuous random variable $X$ whose distribution is conditioned on another discrete random variable $S$. The conditional density function of $X$ is
- $f_{X|S}(x|1) = alpha e^{-alpha x}, x geq 0$
- $f_{X|S}(x|-1) = beta e^{beta x}, x leq 0$
I can see that when $S=1$, $X sim Exp(alpha)$ with $alpha >0$ and when $S=-1$, $-X sim Exp(beta)$ with $beta >0$. That is, $S$ is the sign of $X$.
I then define $Z = |X|$ and I have to calculate $mathbb{P}(S=1|Z=z)$. I know that this is the posterior probability of $S$ and I can use the Bayes rule for the case of a discrete unknown and continuous observation. The chosen formula is:
$$p_{S|Z}(1|z)= frac{p_S(1)f_{Z|S}(z|1)}{f_Z(z)}$$
and I know from the prior of $S$ that $p_S(1) = p$.
My approach to calculate $f_{Z|S}(z|1)$ would be to consider that, if I know that $S=1$ therefore $Z = X$ and $f_{Z|S}(z|1) = f_{X|S}(x|1)$. What I don't understand is how to come out with the marginal of $Z$. The marginal of $X$ is:
$p cdot alpha e^{-alpha x}$ when $x geq 0$
$(1-p) cdot beta e^{beta x}$ when $x leq 0$
and my idea here is that the marginal of $Z$ is $p cdot alpha e^{-alpha z} + (1-p) cdot beta e^{beta z}$ since the $|X|$ mirrors $-X$ for the negative part, but I get a bit lost at this point.
EDIT: I also thought that, since $f_{X|S}(x|-1) = beta e^{beta x}$ then $f_{Z|S}(z|-1) = beta e^{-beta x}$, therefore
$$f_Z(z) = p cdot alpha e^{-alpha z} + (1-p) cdot beta e^{-beta z}$$
but I don't know whether this is correct.
probability-distributions bayes-theorem
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have a continuous random variable $X$ whose distribution is conditioned on another discrete random variable $S$. The conditional density function of $X$ is
- $f_{X|S}(x|1) = alpha e^{-alpha x}, x geq 0$
- $f_{X|S}(x|-1) = beta e^{beta x}, x leq 0$
I can see that when $S=1$, $X sim Exp(alpha)$ with $alpha >0$ and when $S=-1$, $-X sim Exp(beta)$ with $beta >0$. That is, $S$ is the sign of $X$.
I then define $Z = |X|$ and I have to calculate $mathbb{P}(S=1|Z=z)$. I know that this is the posterior probability of $S$ and I can use the Bayes rule for the case of a discrete unknown and continuous observation. The chosen formula is:
$$p_{S|Z}(1|z)= frac{p_S(1)f_{Z|S}(z|1)}{f_Z(z)}$$
and I know from the prior of $S$ that $p_S(1) = p$.
My approach to calculate $f_{Z|S}(z|1)$ would be to consider that, if I know that $S=1$ therefore $Z = X$ and $f_{Z|S}(z|1) = f_{X|S}(x|1)$. What I don't understand is how to come out with the marginal of $Z$. The marginal of $X$ is:
$p cdot alpha e^{-alpha x}$ when $x geq 0$
$(1-p) cdot beta e^{beta x}$ when $x leq 0$
and my idea here is that the marginal of $Z$ is $p cdot alpha e^{-alpha z} + (1-p) cdot beta e^{beta z}$ since the $|X|$ mirrors $-X$ for the negative part, but I get a bit lost at this point.
EDIT: I also thought that, since $f_{X|S}(x|-1) = beta e^{beta x}$ then $f_{Z|S}(z|-1) = beta e^{-beta x}$, therefore
$$f_Z(z) = p cdot alpha e^{-alpha z} + (1-p) cdot beta e^{-beta z}$$
but I don't know whether this is correct.
probability-distributions bayes-theorem
I have a continuous random variable $X$ whose distribution is conditioned on another discrete random variable $S$. The conditional density function of $X$ is
- $f_{X|S}(x|1) = alpha e^{-alpha x}, x geq 0$
- $f_{X|S}(x|-1) = beta e^{beta x}, x leq 0$
I can see that when $S=1$, $X sim Exp(alpha)$ with $alpha >0$ and when $S=-1$, $-X sim Exp(beta)$ with $beta >0$. That is, $S$ is the sign of $X$.
I then define $Z = |X|$ and I have to calculate $mathbb{P}(S=1|Z=z)$. I know that this is the posterior probability of $S$ and I can use the Bayes rule for the case of a discrete unknown and continuous observation. The chosen formula is:
$$p_{S|Z}(1|z)= frac{p_S(1)f_{Z|S}(z|1)}{f_Z(z)}$$
and I know from the prior of $S$ that $p_S(1) = p$.
My approach to calculate $f_{Z|S}(z|1)$ would be to consider that, if I know that $S=1$ therefore $Z = X$ and $f_{Z|S}(z|1) = f_{X|S}(x|1)$. What I don't understand is how to come out with the marginal of $Z$. The marginal of $X$ is:
$p cdot alpha e^{-alpha x}$ when $x geq 0$
$(1-p) cdot beta e^{beta x}$ when $x leq 0$
and my idea here is that the marginal of $Z$ is $p cdot alpha e^{-alpha z} + (1-p) cdot beta e^{beta z}$ since the $|X|$ mirrors $-X$ for the negative part, but I get a bit lost at this point.
EDIT: I also thought that, since $f_{X|S}(x|-1) = beta e^{beta x}$ then $f_{Z|S}(z|-1) = beta e^{-beta x}$, therefore
$$f_Z(z) = p cdot alpha e^{-alpha z} + (1-p) cdot beta e^{-beta z}$$
but I don't know whether this is correct.
probability-distributions bayes-theorem
probability-distributions bayes-theorem
edited Nov 18 at 10:38
asked Nov 18 at 10:31
Mattia Paterna
1086
1086
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
1
down vote
accepted
For $z ge 0,$
$$begin{align*}
Pr[Z le z] &= Pr[-z le X le z] \
&= Pr[-z le X < 0 mid S = -1]Pr[S = -1] + Pr[0 le X le z mid S = 1]Pr[S = 1] \
&= (1 - e^{beta (-z)})(1-p) + (1 - e^{-alpha z})p.
end{align*}$$
Therefore,
$$f_Z(z) = p alpha e^{-alpha z} + (1-p) beta e^{-beta z}.$$
add a comment |
up vote
1
down vote
Yes your thoughts are correct.
Assuming $P(S=1)=p=1-P(S=-1)$,
we have for all $zge 0$,
begin{align}
P(Zle z)=P(|X|le z)&=P(|X|le zmid S=1)P(S=1)+P(|X|le zmid S=-1)P(S=-1)
\&=P(Xle zmid S=1)p+P(-Xle zmid S=-1)(1-p)
\&=pF_{Xmid S=1}(z)+(1-p)F_{-Xmid S=-1}(z)
end{align}
, where $F$ is the distribution function.
So the density of $Z$ is
begin{align}
f_Z(z)&=pf_{Xmid S=1}(z)+(1-p)f_{-Xmid S=-1}(z)
\&=palpha e^{-alpha z}mathbf1_{zge0}+(1-p)beta e^{-beta z}mathbf1_{zge0}
\&=left[palpha e^{-alpha z}+(1-p)beta e^{-beta z}right]mathbf1_{zge0}
end{align}
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
For $z ge 0,$
$$begin{align*}
Pr[Z le z] &= Pr[-z le X le z] \
&= Pr[-z le X < 0 mid S = -1]Pr[S = -1] + Pr[0 le X le z mid S = 1]Pr[S = 1] \
&= (1 - e^{beta (-z)})(1-p) + (1 - e^{-alpha z})p.
end{align*}$$
Therefore,
$$f_Z(z) = p alpha e^{-alpha z} + (1-p) beta e^{-beta z}.$$
add a comment |
up vote
1
down vote
accepted
For $z ge 0,$
$$begin{align*}
Pr[Z le z] &= Pr[-z le X le z] \
&= Pr[-z le X < 0 mid S = -1]Pr[S = -1] + Pr[0 le X le z mid S = 1]Pr[S = 1] \
&= (1 - e^{beta (-z)})(1-p) + (1 - e^{-alpha z})p.
end{align*}$$
Therefore,
$$f_Z(z) = p alpha e^{-alpha z} + (1-p) beta e^{-beta z}.$$
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
For $z ge 0,$
$$begin{align*}
Pr[Z le z] &= Pr[-z le X le z] \
&= Pr[-z le X < 0 mid S = -1]Pr[S = -1] + Pr[0 le X le z mid S = 1]Pr[S = 1] \
&= (1 - e^{beta (-z)})(1-p) + (1 - e^{-alpha z})p.
end{align*}$$
Therefore,
$$f_Z(z) = p alpha e^{-alpha z} + (1-p) beta e^{-beta z}.$$
For $z ge 0,$
$$begin{align*}
Pr[Z le z] &= Pr[-z le X le z] \
&= Pr[-z le X < 0 mid S = -1]Pr[S = -1] + Pr[0 le X le z mid S = 1]Pr[S = 1] \
&= (1 - e^{beta (-z)})(1-p) + (1 - e^{-alpha z})p.
end{align*}$$
Therefore,
$$f_Z(z) = p alpha e^{-alpha z} + (1-p) beta e^{-beta z}.$$
answered Nov 18 at 11:05
heropup
62.1k65998
62.1k65998
add a comment |
add a comment |
up vote
1
down vote
Yes your thoughts are correct.
Assuming $P(S=1)=p=1-P(S=-1)$,
we have for all $zge 0$,
begin{align}
P(Zle z)=P(|X|le z)&=P(|X|le zmid S=1)P(S=1)+P(|X|le zmid S=-1)P(S=-1)
\&=P(Xle zmid S=1)p+P(-Xle zmid S=-1)(1-p)
\&=pF_{Xmid S=1}(z)+(1-p)F_{-Xmid S=-1}(z)
end{align}
, where $F$ is the distribution function.
So the density of $Z$ is
begin{align}
f_Z(z)&=pf_{Xmid S=1}(z)+(1-p)f_{-Xmid S=-1}(z)
\&=palpha e^{-alpha z}mathbf1_{zge0}+(1-p)beta e^{-beta z}mathbf1_{zge0}
\&=left[palpha e^{-alpha z}+(1-p)beta e^{-beta z}right]mathbf1_{zge0}
end{align}
add a comment |
up vote
1
down vote
Yes your thoughts are correct.
Assuming $P(S=1)=p=1-P(S=-1)$,
we have for all $zge 0$,
begin{align}
P(Zle z)=P(|X|le z)&=P(|X|le zmid S=1)P(S=1)+P(|X|le zmid S=-1)P(S=-1)
\&=P(Xle zmid S=1)p+P(-Xle zmid S=-1)(1-p)
\&=pF_{Xmid S=1}(z)+(1-p)F_{-Xmid S=-1}(z)
end{align}
, where $F$ is the distribution function.
So the density of $Z$ is
begin{align}
f_Z(z)&=pf_{Xmid S=1}(z)+(1-p)f_{-Xmid S=-1}(z)
\&=palpha e^{-alpha z}mathbf1_{zge0}+(1-p)beta e^{-beta z}mathbf1_{zge0}
\&=left[palpha e^{-alpha z}+(1-p)beta e^{-beta z}right]mathbf1_{zge0}
end{align}
add a comment |
up vote
1
down vote
up vote
1
down vote
Yes your thoughts are correct.
Assuming $P(S=1)=p=1-P(S=-1)$,
we have for all $zge 0$,
begin{align}
P(Zle z)=P(|X|le z)&=P(|X|le zmid S=1)P(S=1)+P(|X|le zmid S=-1)P(S=-1)
\&=P(Xle zmid S=1)p+P(-Xle zmid S=-1)(1-p)
\&=pF_{Xmid S=1}(z)+(1-p)F_{-Xmid S=-1}(z)
end{align}
, where $F$ is the distribution function.
So the density of $Z$ is
begin{align}
f_Z(z)&=pf_{Xmid S=1}(z)+(1-p)f_{-Xmid S=-1}(z)
\&=palpha e^{-alpha z}mathbf1_{zge0}+(1-p)beta e^{-beta z}mathbf1_{zge0}
\&=left[palpha e^{-alpha z}+(1-p)beta e^{-beta z}right]mathbf1_{zge0}
end{align}
Yes your thoughts are correct.
Assuming $P(S=1)=p=1-P(S=-1)$,
we have for all $zge 0$,
begin{align}
P(Zle z)=P(|X|le z)&=P(|X|le zmid S=1)P(S=1)+P(|X|le zmid S=-1)P(S=-1)
\&=P(Xle zmid S=1)p+P(-Xle zmid S=-1)(1-p)
\&=pF_{Xmid S=1}(z)+(1-p)F_{-Xmid S=-1}(z)
end{align}
, where $F$ is the distribution function.
So the density of $Z$ is
begin{align}
f_Z(z)&=pf_{Xmid S=1}(z)+(1-p)f_{-Xmid S=-1}(z)
\&=palpha e^{-alpha z}mathbf1_{zge0}+(1-p)beta e^{-beta z}mathbf1_{zge0}
\&=left[palpha e^{-alpha z}+(1-p)beta e^{-beta z}right]mathbf1_{zge0}
end{align}
answered Nov 18 at 11:04
StubbornAtom
4,92411137
4,92411137
add a comment |
add a comment |
Thanks for contributing an answer to Mathematics Stack Exchange!
- 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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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.
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%2fmath.stackexchange.com%2fquestions%2f3003359%2fmarginal-density-of-x%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