Designing a hypothesis test for a gamma distributed RV and a given significance level
$begingroup$
I am stuck at the follwoing problem:
Consider the exponentially distributed RVs $X_1, X_2, ldots, X_9$ with parameter $lambda$. We reject $H_0: lambda ge 1$ in favor of $H_A: lambda < 1$ if $overline{X} ge k$.
We want to reach the significance level $alpha = 0.05$. Find $k$ and calculate the powerfunction at $lambda = 0.5$.
Since the sum of $n$ exponentially distributed RVs (with parameter $lambda$) is $Gamma_{n, 1/lambda}$ distributed the problem reduces itself to find a $k$ such that
$$alpha = P_lambda(overline{X} ge k) = int_{k}^infty frac{1}{9}cdotGamma_{9, 1/lambda } dlambda$$
if I am not mistaken. But I am haveing a hard time finding a suitable $k$. Could you help me ?
statistics
$endgroup$
|
show 2 more comments
$begingroup$
I am stuck at the follwoing problem:
Consider the exponentially distributed RVs $X_1, X_2, ldots, X_9$ with parameter $lambda$. We reject $H_0: lambda ge 1$ in favor of $H_A: lambda < 1$ if $overline{X} ge k$.
We want to reach the significance level $alpha = 0.05$. Find $k$ and calculate the powerfunction at $lambda = 0.5$.
Since the sum of $n$ exponentially distributed RVs (with parameter $lambda$) is $Gamma_{n, 1/lambda}$ distributed the problem reduces itself to find a $k$ such that
$$alpha = P_lambda(overline{X} ge k) = int_{k}^infty frac{1}{9}cdotGamma_{9, 1/lambda } dlambda$$
if I am not mistaken. But I am haveing a hard time finding a suitable $k$. Could you help me ?
statistics
$endgroup$
1
$begingroup$
It depends on your tools. R'sqgammaandpgammafunctions will give you $k$ and then the power. Or you could use a normal approximation
$endgroup$
– Henry
Dec 5 '18 at 10:42
$begingroup$
I am supposed to do this by hand unfortunately
$endgroup$
– 3nondatur
Dec 5 '18 at 10:58
$begingroup$
By parameter $lambda$, do you mean the pdf is $lambda e^{-lambda x}mathbf1_{x>0}$?
$endgroup$
– StubbornAtom
Dec 5 '18 at 13:18
$begingroup$
@StubbornAtom $lambda$ is likely to be the rate or mean of the exponential distribution. Given that the critical region is associated with low $lambda$ and higher values, I think we can assume $lambda$ is the rate
$endgroup$
– Henry
Dec 5 '18 at 14:32
1
$begingroup$
In that case you can get $k$ as a fractile of $chi^2_{18}$ distribution using a chi-square table, because with the above pdf, $X_istackrel{text{ i.i.d }}simtext{Exp}text{ with mean }1/lambdaimplies 2lambda X_istackrel{text{ i.i.d }}simtext{Exp}text{ with mean }2equivchi^2_2implies 2lambdasum_{i=1}^9 X_isimchi^2_{18}$. In other words, $18lambdaoverline Xsimchi^2_{18}$.
$endgroup$
– StubbornAtom
Dec 5 '18 at 17:25
|
show 2 more comments
$begingroup$
I am stuck at the follwoing problem:
Consider the exponentially distributed RVs $X_1, X_2, ldots, X_9$ with parameter $lambda$. We reject $H_0: lambda ge 1$ in favor of $H_A: lambda < 1$ if $overline{X} ge k$.
We want to reach the significance level $alpha = 0.05$. Find $k$ and calculate the powerfunction at $lambda = 0.5$.
Since the sum of $n$ exponentially distributed RVs (with parameter $lambda$) is $Gamma_{n, 1/lambda}$ distributed the problem reduces itself to find a $k$ such that
$$alpha = P_lambda(overline{X} ge k) = int_{k}^infty frac{1}{9}cdotGamma_{9, 1/lambda } dlambda$$
if I am not mistaken. But I am haveing a hard time finding a suitable $k$. Could you help me ?
statistics
$endgroup$
I am stuck at the follwoing problem:
Consider the exponentially distributed RVs $X_1, X_2, ldots, X_9$ with parameter $lambda$. We reject $H_0: lambda ge 1$ in favor of $H_A: lambda < 1$ if $overline{X} ge k$.
We want to reach the significance level $alpha = 0.05$. Find $k$ and calculate the powerfunction at $lambda = 0.5$.
Since the sum of $n$ exponentially distributed RVs (with parameter $lambda$) is $Gamma_{n, 1/lambda}$ distributed the problem reduces itself to find a $k$ such that
$$alpha = P_lambda(overline{X} ge k) = int_{k}^infty frac{1}{9}cdotGamma_{9, 1/lambda } dlambda$$
if I am not mistaken. But I am haveing a hard time finding a suitable $k$. Could you help me ?
statistics
statistics
asked Dec 5 '18 at 10:17
3nondatur3nondatur
399111
399111
1
$begingroup$
It depends on your tools. R'sqgammaandpgammafunctions will give you $k$ and then the power. Or you could use a normal approximation
$endgroup$
– Henry
Dec 5 '18 at 10:42
$begingroup$
I am supposed to do this by hand unfortunately
$endgroup$
– 3nondatur
Dec 5 '18 at 10:58
$begingroup$
By parameter $lambda$, do you mean the pdf is $lambda e^{-lambda x}mathbf1_{x>0}$?
$endgroup$
– StubbornAtom
Dec 5 '18 at 13:18
$begingroup$
@StubbornAtom $lambda$ is likely to be the rate or mean of the exponential distribution. Given that the critical region is associated with low $lambda$ and higher values, I think we can assume $lambda$ is the rate
$endgroup$
– Henry
Dec 5 '18 at 14:32
1
$begingroup$
In that case you can get $k$ as a fractile of $chi^2_{18}$ distribution using a chi-square table, because with the above pdf, $X_istackrel{text{ i.i.d }}simtext{Exp}text{ with mean }1/lambdaimplies 2lambda X_istackrel{text{ i.i.d }}simtext{Exp}text{ with mean }2equivchi^2_2implies 2lambdasum_{i=1}^9 X_isimchi^2_{18}$. In other words, $18lambdaoverline Xsimchi^2_{18}$.
$endgroup$
– StubbornAtom
Dec 5 '18 at 17:25
|
show 2 more comments
1
$begingroup$
It depends on your tools. R'sqgammaandpgammafunctions will give you $k$ and then the power. Or you could use a normal approximation
$endgroup$
– Henry
Dec 5 '18 at 10:42
$begingroup$
I am supposed to do this by hand unfortunately
$endgroup$
– 3nondatur
Dec 5 '18 at 10:58
$begingroup$
By parameter $lambda$, do you mean the pdf is $lambda e^{-lambda x}mathbf1_{x>0}$?
$endgroup$
– StubbornAtom
Dec 5 '18 at 13:18
$begingroup$
@StubbornAtom $lambda$ is likely to be the rate or mean of the exponential distribution. Given that the critical region is associated with low $lambda$ and higher values, I think we can assume $lambda$ is the rate
$endgroup$
– Henry
Dec 5 '18 at 14:32
1
$begingroup$
In that case you can get $k$ as a fractile of $chi^2_{18}$ distribution using a chi-square table, because with the above pdf, $X_istackrel{text{ i.i.d }}simtext{Exp}text{ with mean }1/lambdaimplies 2lambda X_istackrel{text{ i.i.d }}simtext{Exp}text{ with mean }2equivchi^2_2implies 2lambdasum_{i=1}^9 X_isimchi^2_{18}$. In other words, $18lambdaoverline Xsimchi^2_{18}$.
$endgroup$
– StubbornAtom
Dec 5 '18 at 17:25
1
1
$begingroup$
It depends on your tools. R's
qgamma and pgamma functions will give you $k$ and then the power. Or you could use a normal approximation$endgroup$
– Henry
Dec 5 '18 at 10:42
$begingroup$
It depends on your tools. R's
qgamma and pgamma functions will give you $k$ and then the power. Or you could use a normal approximation$endgroup$
– Henry
Dec 5 '18 at 10:42
$begingroup$
I am supposed to do this by hand unfortunately
$endgroup$
– 3nondatur
Dec 5 '18 at 10:58
$begingroup$
I am supposed to do this by hand unfortunately
$endgroup$
– 3nondatur
Dec 5 '18 at 10:58
$begingroup$
By parameter $lambda$, do you mean the pdf is $lambda e^{-lambda x}mathbf1_{x>0}$?
$endgroup$
– StubbornAtom
Dec 5 '18 at 13:18
$begingroup$
By parameter $lambda$, do you mean the pdf is $lambda e^{-lambda x}mathbf1_{x>0}$?
$endgroup$
– StubbornAtom
Dec 5 '18 at 13:18
$begingroup$
@StubbornAtom $lambda$ is likely to be the rate or mean of the exponential distribution. Given that the critical region is associated with low $lambda$ and higher values, I think we can assume $lambda$ is the rate
$endgroup$
– Henry
Dec 5 '18 at 14:32
$begingroup$
@StubbornAtom $lambda$ is likely to be the rate or mean of the exponential distribution. Given that the critical region is associated with low $lambda$ and higher values, I think we can assume $lambda$ is the rate
$endgroup$
– Henry
Dec 5 '18 at 14:32
1
1
$begingroup$
In that case you can get $k$ as a fractile of $chi^2_{18}$ distribution using a chi-square table, because with the above pdf, $X_istackrel{text{ i.i.d }}simtext{Exp}text{ with mean }1/lambdaimplies 2lambda X_istackrel{text{ i.i.d }}simtext{Exp}text{ with mean }2equivchi^2_2implies 2lambdasum_{i=1}^9 X_isimchi^2_{18}$. In other words, $18lambdaoverline Xsimchi^2_{18}$.
$endgroup$
– StubbornAtom
Dec 5 '18 at 17:25
$begingroup$
In that case you can get $k$ as a fractile of $chi^2_{18}$ distribution using a chi-square table, because with the above pdf, $X_istackrel{text{ i.i.d }}simtext{Exp}text{ with mean }1/lambdaimplies 2lambda X_istackrel{text{ i.i.d }}simtext{Exp}text{ with mean }2equivchi^2_2implies 2lambdasum_{i=1}^9 X_isimchi^2_{18}$. In other words, $18lambdaoverline Xsimchi^2_{18}$.
$endgroup$
– StubbornAtom
Dec 5 '18 at 17:25
|
show 2 more comments
1 Answer
1
active
oldest
votes
$begingroup$
Hypothesis test for exponential rate. Suppose $n = 60,$ so that you have a random sample $X_1, X_2, dots, X_{50}$
from $mathsf{Exp}(text{rate} = lambda).$ Then $bar X
sim mathsf{Gamma}(text{shape} = n, text{rate} = nlambda).$
If you are testing $H_0: lambda ge 1$ against $H_a:lambda < 1,$
then you want to reject when $bar X ge c$ where $c$ cuts probability
$0.05$ from the upper tail of the null distribution
$mathsf{Gamma}(50,50).$ [Notice that large values of $bar X$ correspond to small values of $lambda$ because the exponential mean $mu = 1/lambda.]$
In R one finds $c = 1.243421.$
qgamma(.95, 50, 50)
[1] 0.7792947
[If you are allergic to software, then you could use the relationship between gamma and chi-squared distributions to get $c$ from printed tables of the chi-squared distribution.]
Example not leading to rejection. For example, suppose I have a sample x with $bar X = 1.008.$
set.seed(2005) # generate fake data with rate 1
x = rexp(50, 1)
summary(x)
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.01236 0.27856 0.69518 1.00772 1.42997 6.01451
Then you do not reject $H_0: lambda le 1$ because $1.008 < c.$
The p-value of this test is the probability $0.46$ under the null distribution
that a mean greater than $1.008$ is observed.
1 - pgamma(1.008, 50, 50)
[1] 0.4587632

Power of the test. Suppose that in fact $lambda = 1/2.$ Then the power of this test
is the probability $0.9989$ of rejecting (getting $X ge 1.2434)$ under the alternative
distribution $mathsf{Gamma}(n, n/2).$
Intuitively, with $n = 50$ observations, it is not difficult to tell the difference between
an exponential rate of $lambda = 1$ and an exponential rate of $lambda = 1/2.$ (In the figure below, the two density curves have little area in common.)
1 - pgamma(1.2434, 50, 50/2)
[1] 0.9989138
Example leading to rejection As an example, suppose we have a sample y with $bar Y = 1.573.$
Then we reject $H_0: lambda ge 1$ in favor of the alternative
$H_0: lambda < 1.$ because $bar Y = 1.573 > 1.2434.$
set.seed)2018) # generate fake data with rate 1/2
y = rexp(50, 1/2)
summary(y)
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.01971 0.47256 1.01072 1.57307 2.22232 8.82067
The p-value for the Y-sample is very small (much below 5%).
1 - pgamma(1.573, 50, 50)
[1] 0.0002244243
[It is difficult to use printed distribution tables to
find p-values.]
In the figure below, the p-value is the very small area under the grey null curve to the right of the vertical dotted line (at the observed value $bar Y).$ The power of the test is the large
area under the heavy black alternative curve
to the right of the vertical red line (at the
critical value).

$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%2f3026900%2fdesigning-a-hypothesis-test-for-a-gamma-distributed-rv-and-a-given-significance%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$
Hypothesis test for exponential rate. Suppose $n = 60,$ so that you have a random sample $X_1, X_2, dots, X_{50}$
from $mathsf{Exp}(text{rate} = lambda).$ Then $bar X
sim mathsf{Gamma}(text{shape} = n, text{rate} = nlambda).$
If you are testing $H_0: lambda ge 1$ against $H_a:lambda < 1,$
then you want to reject when $bar X ge c$ where $c$ cuts probability
$0.05$ from the upper tail of the null distribution
$mathsf{Gamma}(50,50).$ [Notice that large values of $bar X$ correspond to small values of $lambda$ because the exponential mean $mu = 1/lambda.]$
In R one finds $c = 1.243421.$
qgamma(.95, 50, 50)
[1] 0.7792947
[If you are allergic to software, then you could use the relationship between gamma and chi-squared distributions to get $c$ from printed tables of the chi-squared distribution.]
Example not leading to rejection. For example, suppose I have a sample x with $bar X = 1.008.$
set.seed(2005) # generate fake data with rate 1
x = rexp(50, 1)
summary(x)
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.01236 0.27856 0.69518 1.00772 1.42997 6.01451
Then you do not reject $H_0: lambda le 1$ because $1.008 < c.$
The p-value of this test is the probability $0.46$ under the null distribution
that a mean greater than $1.008$ is observed.
1 - pgamma(1.008, 50, 50)
[1] 0.4587632

Power of the test. Suppose that in fact $lambda = 1/2.$ Then the power of this test
is the probability $0.9989$ of rejecting (getting $X ge 1.2434)$ under the alternative
distribution $mathsf{Gamma}(n, n/2).$
Intuitively, with $n = 50$ observations, it is not difficult to tell the difference between
an exponential rate of $lambda = 1$ and an exponential rate of $lambda = 1/2.$ (In the figure below, the two density curves have little area in common.)
1 - pgamma(1.2434, 50, 50/2)
[1] 0.9989138
Example leading to rejection As an example, suppose we have a sample y with $bar Y = 1.573.$
Then we reject $H_0: lambda ge 1$ in favor of the alternative
$H_0: lambda < 1.$ because $bar Y = 1.573 > 1.2434.$
set.seed)2018) # generate fake data with rate 1/2
y = rexp(50, 1/2)
summary(y)
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.01971 0.47256 1.01072 1.57307 2.22232 8.82067
The p-value for the Y-sample is very small (much below 5%).
1 - pgamma(1.573, 50, 50)
[1] 0.0002244243
[It is difficult to use printed distribution tables to
find p-values.]
In the figure below, the p-value is the very small area under the grey null curve to the right of the vertical dotted line (at the observed value $bar Y).$ The power of the test is the large
area under the heavy black alternative curve
to the right of the vertical red line (at the
critical value).

$endgroup$
add a comment |
$begingroup$
Hypothesis test for exponential rate. Suppose $n = 60,$ so that you have a random sample $X_1, X_2, dots, X_{50}$
from $mathsf{Exp}(text{rate} = lambda).$ Then $bar X
sim mathsf{Gamma}(text{shape} = n, text{rate} = nlambda).$
If you are testing $H_0: lambda ge 1$ against $H_a:lambda < 1,$
then you want to reject when $bar X ge c$ where $c$ cuts probability
$0.05$ from the upper tail of the null distribution
$mathsf{Gamma}(50,50).$ [Notice that large values of $bar X$ correspond to small values of $lambda$ because the exponential mean $mu = 1/lambda.]$
In R one finds $c = 1.243421.$
qgamma(.95, 50, 50)
[1] 0.7792947
[If you are allergic to software, then you could use the relationship between gamma and chi-squared distributions to get $c$ from printed tables of the chi-squared distribution.]
Example not leading to rejection. For example, suppose I have a sample x with $bar X = 1.008.$
set.seed(2005) # generate fake data with rate 1
x = rexp(50, 1)
summary(x)
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.01236 0.27856 0.69518 1.00772 1.42997 6.01451
Then you do not reject $H_0: lambda le 1$ because $1.008 < c.$
The p-value of this test is the probability $0.46$ under the null distribution
that a mean greater than $1.008$ is observed.
1 - pgamma(1.008, 50, 50)
[1] 0.4587632

Power of the test. Suppose that in fact $lambda = 1/2.$ Then the power of this test
is the probability $0.9989$ of rejecting (getting $X ge 1.2434)$ under the alternative
distribution $mathsf{Gamma}(n, n/2).$
Intuitively, with $n = 50$ observations, it is not difficult to tell the difference between
an exponential rate of $lambda = 1$ and an exponential rate of $lambda = 1/2.$ (In the figure below, the two density curves have little area in common.)
1 - pgamma(1.2434, 50, 50/2)
[1] 0.9989138
Example leading to rejection As an example, suppose we have a sample y with $bar Y = 1.573.$
Then we reject $H_0: lambda ge 1$ in favor of the alternative
$H_0: lambda < 1.$ because $bar Y = 1.573 > 1.2434.$
set.seed)2018) # generate fake data with rate 1/2
y = rexp(50, 1/2)
summary(y)
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.01971 0.47256 1.01072 1.57307 2.22232 8.82067
The p-value for the Y-sample is very small (much below 5%).
1 - pgamma(1.573, 50, 50)
[1] 0.0002244243
[It is difficult to use printed distribution tables to
find p-values.]
In the figure below, the p-value is the very small area under the grey null curve to the right of the vertical dotted line (at the observed value $bar Y).$ The power of the test is the large
area under the heavy black alternative curve
to the right of the vertical red line (at the
critical value).

$endgroup$
add a comment |
$begingroup$
Hypothesis test for exponential rate. Suppose $n = 60,$ so that you have a random sample $X_1, X_2, dots, X_{50}$
from $mathsf{Exp}(text{rate} = lambda).$ Then $bar X
sim mathsf{Gamma}(text{shape} = n, text{rate} = nlambda).$
If you are testing $H_0: lambda ge 1$ against $H_a:lambda < 1,$
then you want to reject when $bar X ge c$ where $c$ cuts probability
$0.05$ from the upper tail of the null distribution
$mathsf{Gamma}(50,50).$ [Notice that large values of $bar X$ correspond to small values of $lambda$ because the exponential mean $mu = 1/lambda.]$
In R one finds $c = 1.243421.$
qgamma(.95, 50, 50)
[1] 0.7792947
[If you are allergic to software, then you could use the relationship between gamma and chi-squared distributions to get $c$ from printed tables of the chi-squared distribution.]
Example not leading to rejection. For example, suppose I have a sample x with $bar X = 1.008.$
set.seed(2005) # generate fake data with rate 1
x = rexp(50, 1)
summary(x)
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.01236 0.27856 0.69518 1.00772 1.42997 6.01451
Then you do not reject $H_0: lambda le 1$ because $1.008 < c.$
The p-value of this test is the probability $0.46$ under the null distribution
that a mean greater than $1.008$ is observed.
1 - pgamma(1.008, 50, 50)
[1] 0.4587632

Power of the test. Suppose that in fact $lambda = 1/2.$ Then the power of this test
is the probability $0.9989$ of rejecting (getting $X ge 1.2434)$ under the alternative
distribution $mathsf{Gamma}(n, n/2).$
Intuitively, with $n = 50$ observations, it is not difficult to tell the difference between
an exponential rate of $lambda = 1$ and an exponential rate of $lambda = 1/2.$ (In the figure below, the two density curves have little area in common.)
1 - pgamma(1.2434, 50, 50/2)
[1] 0.9989138
Example leading to rejection As an example, suppose we have a sample y with $bar Y = 1.573.$
Then we reject $H_0: lambda ge 1$ in favor of the alternative
$H_0: lambda < 1.$ because $bar Y = 1.573 > 1.2434.$
set.seed)2018) # generate fake data with rate 1/2
y = rexp(50, 1/2)
summary(y)
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.01971 0.47256 1.01072 1.57307 2.22232 8.82067
The p-value for the Y-sample is very small (much below 5%).
1 - pgamma(1.573, 50, 50)
[1] 0.0002244243
[It is difficult to use printed distribution tables to
find p-values.]
In the figure below, the p-value is the very small area under the grey null curve to the right of the vertical dotted line (at the observed value $bar Y).$ The power of the test is the large
area under the heavy black alternative curve
to the right of the vertical red line (at the
critical value).

$endgroup$
Hypothesis test for exponential rate. Suppose $n = 60,$ so that you have a random sample $X_1, X_2, dots, X_{50}$
from $mathsf{Exp}(text{rate} = lambda).$ Then $bar X
sim mathsf{Gamma}(text{shape} = n, text{rate} = nlambda).$
If you are testing $H_0: lambda ge 1$ against $H_a:lambda < 1,$
then you want to reject when $bar X ge c$ where $c$ cuts probability
$0.05$ from the upper tail of the null distribution
$mathsf{Gamma}(50,50).$ [Notice that large values of $bar X$ correspond to small values of $lambda$ because the exponential mean $mu = 1/lambda.]$
In R one finds $c = 1.243421.$
qgamma(.95, 50, 50)
[1] 0.7792947
[If you are allergic to software, then you could use the relationship between gamma and chi-squared distributions to get $c$ from printed tables of the chi-squared distribution.]
Example not leading to rejection. For example, suppose I have a sample x with $bar X = 1.008.$
set.seed(2005) # generate fake data with rate 1
x = rexp(50, 1)
summary(x)
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.01236 0.27856 0.69518 1.00772 1.42997 6.01451
Then you do not reject $H_0: lambda le 1$ because $1.008 < c.$
The p-value of this test is the probability $0.46$ under the null distribution
that a mean greater than $1.008$ is observed.
1 - pgamma(1.008, 50, 50)
[1] 0.4587632

Power of the test. Suppose that in fact $lambda = 1/2.$ Then the power of this test
is the probability $0.9989$ of rejecting (getting $X ge 1.2434)$ under the alternative
distribution $mathsf{Gamma}(n, n/2).$
Intuitively, with $n = 50$ observations, it is not difficult to tell the difference between
an exponential rate of $lambda = 1$ and an exponential rate of $lambda = 1/2.$ (In the figure below, the two density curves have little area in common.)
1 - pgamma(1.2434, 50, 50/2)
[1] 0.9989138
Example leading to rejection As an example, suppose we have a sample y with $bar Y = 1.573.$
Then we reject $H_0: lambda ge 1$ in favor of the alternative
$H_0: lambda < 1.$ because $bar Y = 1.573 > 1.2434.$
set.seed)2018) # generate fake data with rate 1/2
y = rexp(50, 1/2)
summary(y)
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.01971 0.47256 1.01072 1.57307 2.22232 8.82067
The p-value for the Y-sample is very small (much below 5%).
1 - pgamma(1.573, 50, 50)
[1] 0.0002244243
[It is difficult to use printed distribution tables to
find p-values.]
In the figure below, the p-value is the very small area under the grey null curve to the right of the vertical dotted line (at the observed value $bar Y).$ The power of the test is the large
area under the heavy black alternative curve
to the right of the vertical red line (at the
critical value).

edited Dec 6 '18 at 2:41
answered Dec 6 '18 at 1:38
BruceETBruceET
35.8k71440
35.8k71440
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%2f3026900%2fdesigning-a-hypothesis-test-for-a-gamma-distributed-rv-and-a-given-significance%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
1
$begingroup$
It depends on your tools. R's
qgammaandpgammafunctions will give you $k$ and then the power. Or you could use a normal approximation$endgroup$
– Henry
Dec 5 '18 at 10:42
$begingroup$
I am supposed to do this by hand unfortunately
$endgroup$
– 3nondatur
Dec 5 '18 at 10:58
$begingroup$
By parameter $lambda$, do you mean the pdf is $lambda e^{-lambda x}mathbf1_{x>0}$?
$endgroup$
– StubbornAtom
Dec 5 '18 at 13:18
$begingroup$
@StubbornAtom $lambda$ is likely to be the rate or mean of the exponential distribution. Given that the critical region is associated with low $lambda$ and higher values, I think we can assume $lambda$ is the rate
$endgroup$
– Henry
Dec 5 '18 at 14:32
1
$begingroup$
In that case you can get $k$ as a fractile of $chi^2_{18}$ distribution using a chi-square table, because with the above pdf, $X_istackrel{text{ i.i.d }}simtext{Exp}text{ with mean }1/lambdaimplies 2lambda X_istackrel{text{ i.i.d }}simtext{Exp}text{ with mean }2equivchi^2_2implies 2lambdasum_{i=1}^9 X_isimchi^2_{18}$. In other words, $18lambdaoverline Xsimchi^2_{18}$.
$endgroup$
– StubbornAtom
Dec 5 '18 at 17:25