Median from probability density function
$begingroup$
I have a probability density function:
$f(x) = begin{cases} frac 1 4xe^{frac {-x}2}, & xge0 \ 0, & x < 0end{cases}$
To add more detail, cdf is:
$F(x) = begin{cases} 1+frac{-1}2xe^{frac {-x}2}-e^{frac {-x}2}, & xge0 \ 0, & x < 0end{cases}$
Find the $Med(x)$.
Solving
$$int_{-infty}^{x} f(x) dx=1+frac{-1}2xe^{frac {-x}2}-e^{frac {-x}2}=frac 12$$
I found 2 values $3.3567$ and $-1.5361$, and my book said that the answer is $-1.5361$. This is confusing because I thought $Med(X)ge 0$.
probability probability-theory probability-distributions
$endgroup$
|
show 2 more comments
$begingroup$
I have a probability density function:
$f(x) = begin{cases} frac 1 4xe^{frac {-x}2}, & xge0 \ 0, & x < 0end{cases}$
To add more detail, cdf is:
$F(x) = begin{cases} 1+frac{-1}2xe^{frac {-x}2}-e^{frac {-x}2}, & xge0 \ 0, & x < 0end{cases}$
Find the $Med(x)$.
Solving
$$int_{-infty}^{x} f(x) dx=1+frac{-1}2xe^{frac {-x}2}-e^{frac {-x}2}=frac 12$$
I found 2 values $3.3567$ and $-1.5361$, and my book said that the answer is $-1.5361$. This is confusing because I thought $Med(X)ge 0$.
probability probability-theory probability-distributions
$endgroup$
$begingroup$
The median is unique. So you can’t find two values.
$endgroup$
– mathcounterexamples.net
Dec 26 '18 at 13:16
$begingroup$
I solve the equation and it gives me 2 $x$ values, I haven't determined which $Med(X)$ is yet.
$endgroup$
– Tjh Thon
Dec 26 '18 at 13:17
$begingroup$
Which equation did you solve? Please update the question with what you did.
$endgroup$
– mathcounterexamples.net
Dec 26 '18 at 13:18
$begingroup$
I have edited my post.
$endgroup$
– Tjh Thon
Dec 26 '18 at 13:24
2
$begingroup$
Only the non-negative solution should be median since you used that part of the cdf for which $xge 0$; $F(x)$ cannot be $1/2$ for any $x<0$.
$endgroup$
– StubbornAtom
Dec 26 '18 at 13:46
|
show 2 more comments
$begingroup$
I have a probability density function:
$f(x) = begin{cases} frac 1 4xe^{frac {-x}2}, & xge0 \ 0, & x < 0end{cases}$
To add more detail, cdf is:
$F(x) = begin{cases} 1+frac{-1}2xe^{frac {-x}2}-e^{frac {-x}2}, & xge0 \ 0, & x < 0end{cases}$
Find the $Med(x)$.
Solving
$$int_{-infty}^{x} f(x) dx=1+frac{-1}2xe^{frac {-x}2}-e^{frac {-x}2}=frac 12$$
I found 2 values $3.3567$ and $-1.5361$, and my book said that the answer is $-1.5361$. This is confusing because I thought $Med(X)ge 0$.
probability probability-theory probability-distributions
$endgroup$
I have a probability density function:
$f(x) = begin{cases} frac 1 4xe^{frac {-x}2}, & xge0 \ 0, & x < 0end{cases}$
To add more detail, cdf is:
$F(x) = begin{cases} 1+frac{-1}2xe^{frac {-x}2}-e^{frac {-x}2}, & xge0 \ 0, & x < 0end{cases}$
Find the $Med(x)$.
Solving
$$int_{-infty}^{x} f(x) dx=1+frac{-1}2xe^{frac {-x}2}-e^{frac {-x}2}=frac 12$$
I found 2 values $3.3567$ and $-1.5361$, and my book said that the answer is $-1.5361$. This is confusing because I thought $Med(X)ge 0$.
probability probability-theory probability-distributions
probability probability-theory probability-distributions
edited Dec 26 '18 at 13:38
Tjh Thon
asked Dec 26 '18 at 13:14
Tjh ThonTjh Thon
112
112
$begingroup$
The median is unique. So you can’t find two values.
$endgroup$
– mathcounterexamples.net
Dec 26 '18 at 13:16
$begingroup$
I solve the equation and it gives me 2 $x$ values, I haven't determined which $Med(X)$ is yet.
$endgroup$
– Tjh Thon
Dec 26 '18 at 13:17
$begingroup$
Which equation did you solve? Please update the question with what you did.
$endgroup$
– mathcounterexamples.net
Dec 26 '18 at 13:18
$begingroup$
I have edited my post.
$endgroup$
– Tjh Thon
Dec 26 '18 at 13:24
2
$begingroup$
Only the non-negative solution should be median since you used that part of the cdf for which $xge 0$; $F(x)$ cannot be $1/2$ for any $x<0$.
$endgroup$
– StubbornAtom
Dec 26 '18 at 13:46
|
show 2 more comments
$begingroup$
The median is unique. So you can’t find two values.
$endgroup$
– mathcounterexamples.net
Dec 26 '18 at 13:16
$begingroup$
I solve the equation and it gives me 2 $x$ values, I haven't determined which $Med(X)$ is yet.
$endgroup$
– Tjh Thon
Dec 26 '18 at 13:17
$begingroup$
Which equation did you solve? Please update the question with what you did.
$endgroup$
– mathcounterexamples.net
Dec 26 '18 at 13:18
$begingroup$
I have edited my post.
$endgroup$
– Tjh Thon
Dec 26 '18 at 13:24
2
$begingroup$
Only the non-negative solution should be median since you used that part of the cdf for which $xge 0$; $F(x)$ cannot be $1/2$ for any $x<0$.
$endgroup$
– StubbornAtom
Dec 26 '18 at 13:46
$begingroup$
The median is unique. So you can’t find two values.
$endgroup$
– mathcounterexamples.net
Dec 26 '18 at 13:16
$begingroup$
The median is unique. So you can’t find two values.
$endgroup$
– mathcounterexamples.net
Dec 26 '18 at 13:16
$begingroup$
I solve the equation and it gives me 2 $x$ values, I haven't determined which $Med(X)$ is yet.
$endgroup$
– Tjh Thon
Dec 26 '18 at 13:17
$begingroup$
I solve the equation and it gives me 2 $x$ values, I haven't determined which $Med(X)$ is yet.
$endgroup$
– Tjh Thon
Dec 26 '18 at 13:17
$begingroup$
Which equation did you solve? Please update the question with what you did.
$endgroup$
– mathcounterexamples.net
Dec 26 '18 at 13:18
$begingroup$
Which equation did you solve? Please update the question with what you did.
$endgroup$
– mathcounterexamples.net
Dec 26 '18 at 13:18
$begingroup$
I have edited my post.
$endgroup$
– Tjh Thon
Dec 26 '18 at 13:24
$begingroup$
I have edited my post.
$endgroup$
– Tjh Thon
Dec 26 '18 at 13:24
2
2
$begingroup$
Only the non-negative solution should be median since you used that part of the cdf for which $xge 0$; $F(x)$ cannot be $1/2$ for any $x<0$.
$endgroup$
– StubbornAtom
Dec 26 '18 at 13:46
$begingroup$
Only the non-negative solution should be median since you used that part of the cdf for which $xge 0$; $F(x)$ cannot be $1/2$ for any $x<0$.
$endgroup$
– StubbornAtom
Dec 26 '18 at 13:46
|
show 2 more comments
1 Answer
1
active
oldest
votes
$begingroup$
Your PDF is for the distribution $mathsf{Gamma}(text{shape}=2,text{rate}=frac 1 2).$
See the relevant Wikipedia page (or your textbook) for details. You seek $F_X^{-1}(frac 1 2) = 3.356694.$
In R statistical software, the inverse CDF (quantile function)
is denoted qgamma
with appropriate arguments.
qgamma(.5,2,1/2)
[1] 3.356694
I agree with the comment of @StubbornAtom, that the median
cannot be negative. The "answer" −1.5361 is simply wrong.
Here is a graph of the PDF, with the location of the median
shown by a dotted red line.
$endgroup$
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: "69"
};
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: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
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
},
noCode: 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%2fmath.stackexchange.com%2fquestions%2f3052932%2fmedian-from-probability-density-function%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$
Your PDF is for the distribution $mathsf{Gamma}(text{shape}=2,text{rate}=frac 1 2).$
See the relevant Wikipedia page (or your textbook) for details. You seek $F_X^{-1}(frac 1 2) = 3.356694.$
In R statistical software, the inverse CDF (quantile function)
is denoted qgamma
with appropriate arguments.
qgamma(.5,2,1/2)
[1] 3.356694
I agree with the comment of @StubbornAtom, that the median
cannot be negative. The "answer" −1.5361 is simply wrong.
Here is a graph of the PDF, with the location of the median
shown by a dotted red line.
$endgroup$
add a comment |
$begingroup$
Your PDF is for the distribution $mathsf{Gamma}(text{shape}=2,text{rate}=frac 1 2).$
See the relevant Wikipedia page (or your textbook) for details. You seek $F_X^{-1}(frac 1 2) = 3.356694.$
In R statistical software, the inverse CDF (quantile function)
is denoted qgamma
with appropriate arguments.
qgamma(.5,2,1/2)
[1] 3.356694
I agree with the comment of @StubbornAtom, that the median
cannot be negative. The "answer" −1.5361 is simply wrong.
Here is a graph of the PDF, with the location of the median
shown by a dotted red line.
$endgroup$
add a comment |
$begingroup$
Your PDF is for the distribution $mathsf{Gamma}(text{shape}=2,text{rate}=frac 1 2).$
See the relevant Wikipedia page (or your textbook) for details. You seek $F_X^{-1}(frac 1 2) = 3.356694.$
In R statistical software, the inverse CDF (quantile function)
is denoted qgamma
with appropriate arguments.
qgamma(.5,2,1/2)
[1] 3.356694
I agree with the comment of @StubbornAtom, that the median
cannot be negative. The "answer" −1.5361 is simply wrong.
Here is a graph of the PDF, with the location of the median
shown by a dotted red line.
$endgroup$
Your PDF is for the distribution $mathsf{Gamma}(text{shape}=2,text{rate}=frac 1 2).$
See the relevant Wikipedia page (or your textbook) for details. You seek $F_X^{-1}(frac 1 2) = 3.356694.$
In R statistical software, the inverse CDF (quantile function)
is denoted qgamma
with appropriate arguments.
qgamma(.5,2,1/2)
[1] 3.356694
I agree with the comment of @StubbornAtom, that the median
cannot be negative. The "answer" −1.5361 is simply wrong.
Here is a graph of the PDF, with the location of the median
shown by a dotted red line.
answered Dec 27 '18 at 8:52
BruceETBruceET
35.7k71440
35.7k71440
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.
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%2f3052932%2fmedian-from-probability-density-function%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
$begingroup$
The median is unique. So you can’t find two values.
$endgroup$
– mathcounterexamples.net
Dec 26 '18 at 13:16
$begingroup$
I solve the equation and it gives me 2 $x$ values, I haven't determined which $Med(X)$ is yet.
$endgroup$
– Tjh Thon
Dec 26 '18 at 13:17
$begingroup$
Which equation did you solve? Please update the question with what you did.
$endgroup$
– mathcounterexamples.net
Dec 26 '18 at 13:18
$begingroup$
I have edited my post.
$endgroup$
– Tjh Thon
Dec 26 '18 at 13:24
2
$begingroup$
Only the non-negative solution should be median since you used that part of the cdf for which $xge 0$; $F(x)$ cannot be $1/2$ for any $x<0$.
$endgroup$
– StubbornAtom
Dec 26 '18 at 13:46