text: # On finding a confidence interval. (exercise)
  
  I am having some problems with the second point of this exercise
  
  Let $(X_1, \dots, X_n)$ be a random sample extracted from a population $X$ that is distributed as a uniform $(0, \theta)$ and let $Y_n = \max (X_1, \dots, X_n)$.
  
  1) If one puts $Q( \theta, X_1 \dots X_n) = Y_n / \theta$ prove that the distribution of $Q$ does not depend on $\theta$.
  
  2) Show how it is then possible to construct a confidence interval for $\theta$.
  
  For point 1 I proceeded as follows (aside from the obvious cases $y < 0, y > 1$) $$P(Y_n / \theta < y) = P(Y_n < y\theta) = (F_X(y \theta))^n = (y\theta / \theta )^n = y^n$$
  
  For point 2 I am a bit lost, anyone mind lending a hand?
  
  • Please add [self-study] tag (stats.stackexchange.com/tags/self-study/info)
  – Tim
  Jul 20 '16 at 11:54
  • @Tim thanks! must say that it is a bit confusing that self-study means two different things in mathstackexchange and crossvalidated. Just noticed it now. I like the guidelines you have here. Jul 20 '16 at 12:03
  • For a CI, you want something like $P(a < \theta < b)=1-\alpha$ which is equivalent to $P(\frac{1}{b} < \frac{1}{\theta}< \frac{1}{a})=1-\alpha$ or $P(\frac{Y_n}{b} < \frac{Y_n}{\theta}< \frac{Y_n}{a})=1-\alpha$. Then you can use what you got from (1). Jul 20 '16 at 12:04
  • @PatrickLi Thanks! but what is $P( \frac{Y_n}{\theta}< \frac{Y_n}{a})$ is it $(Y_n /a )^n$? no that can't be. Sorry I am a bit confused how do I use (1) with all the random variables. Do I do $P( Y_n (a - \theta) /(a \theta) < 0 ) = ?$. Jul 20 '16 at 12:13
  
  For a $100(1-\alpha)\%$ two-sided confidence interval, you want to find $a$ and $b$ such that $P(a < \theta < b) = 1-\alpha$. It is equivalent to $P\left(\frac{Y_n}{b} < \frac{Y_n}{\theta} < \frac{Y_n}{a}\right)=1-\alpha$. So $\frac{Y_n}{b}$ will be the $\frac{\alpha}{2}$ percentile of the distribution of $\frac{Y_n}{\theta}$ and $\frac{Y_n}{a}$ is the $1-\frac{\alpha}{2}$ percentile so the area in between is $1-\alpha$.
  
  In (1), you have that the CDF of $\frac{Y_n}{\theta}$ is $y^n$. Then you can have $\left(\frac{Y_n}{b}\right)^n=\frac{\alpha}{2}$ and $\left(\frac{Y_n}{a}\right)^n=1-\frac{\alpha}{2}$. You can solve for $a$ and $b$ as \begin{align*} a &= \dfrac{Y_n}{\left(1-\frac{\alpha}{2}\right)^{1/n}}\\ b &= \dfrac{Y_n}{\left(\frac{\alpha}{2}\right)^{1/n}} \end{align*}
  
  A $100(1-\alpha)\%$ confidence interval for $\theta$ is $\left[\dfrac{Y_n}{\left(1-\frac{\alpha}{2}\right)^{1/n}}, \dfrac{Y_n}{\left(\frac{\alpha}{2}\right)^{1/n}}\right]$.
  
  A simple simulation in R:
  
  > x <- runif(100, 0, 10)
  > max(x)
  [1] 9.924173
  > max(x)/(1-0.025)^(1/100) # lower bound
  [1] 9.926686
  > max(x)/(0.025)^(1/100) # upper bound
  [1] 10.2971
  
  • Thanks again, I guess what confuses me is that $\left[\dfrac{Y_n}{\left(1-\frac{\alpha}{2}\right)^{1/n}}, \dfrac{Y_n}{\left(\frac{\alpha}{2}\right)^{1/n}}\right]$ is a random interval. I mean we don't get a interval of real numbers. Probably I don't understand confidence intervals correctly. Jul 20 '16 at 13:10
  • @Monolite Yes, confidence interval is a random quantity. If you get a different data set, you will have a different interval. But for a given data set, you will have numbers. Jul 20 '16 at 13:13
  • Patrick I was looking at this answer again and I have a doubt: do you mean $\left(\frac{Y_n}{b}\right)^n=\frac{\alpha}{2}$ or $\left(\frac{Y_n}{b}\right)^n=$ the corresponding percentile of $\frac{\alpha}{2}$ ? Sep 3 '16 at 15:57
explanation: The text extract is a statistics problem that involves constructing a confidence interval for a parameter \(\theta\) based on a random sample from a uniform distribution. The extract contains a question and a partial answer, specifically:
  
  1. The user provides a solution for the first part of the exercise, which involves proving that the distribution of \(Q = Y_n / \theta\) does not depend on \(\theta\).
  2. The user then asks for help with the second part of the exercise, which is to construct a confidence interval for \(\theta\).
  
  The text also includes a comment from another user providing a hint and a detailed solution to the second part of the exercise.
distilabel_metadata.content: Evaluate the user given text extract and determine if it contains a math question and optionally and answer to this question.
  
  Output rules:
  
  1. Briefly describe the document and mention if it contains a question or a question and answer.
  2. Finalize the output with: Label: no-question,question,question-and-answer,multiple-question,multiple-question-and-answer
distilabel_metadata.role: system
distilabel_metadata.content: # On finding a confidence interval. (exercise)
  
  I am having some problems with the second point of this exercise
  
  Let $(X_1, \dots, X_n)$ be a random sample extracted from a population $X$ that is distributed as a uniform $(0, \theta)$ and let $Y_n = \max (X_1, \dots, X_n)$.
  
  1) If one puts $Q( \theta, X_1 \dots X_n) = Y_n / \theta$ prove that the distribution of $Q$ does not depend on $\theta$.
  
  2) Show how it is then possible to construct a confidence interval for $\theta$.
  
  For point 1 I proceeded as follows (aside from the obvious cases $y < 0, y > 1$) $$P(Y_n / \theta < y) = P(Y_n < y\theta) = (F_X(y \theta))^n = (y\theta / \theta )^n = y^n$$
  
  For point 2 I am a bit lost, anyone mind lending a hand?
  
  • Please add [self-study] tag (stats.stackexchange.com/tags/self-study/info)
  – Tim
  Jul 20 '16 at 11:54
  • @Tim thanks! must say that it is a bit confusing that self-study means two different things in mathstackexchange and crossvalidated. Just noticed it now. I like the guidelines you have here. Jul 20 '16 at 12:03
  • For a CI, you want something like $P(a < \theta < b)=1-\alpha$ which is equivalent to $P(\frac{1}{b} < \frac{1}{\theta}< \frac{1}{a})=1-\alpha$ or $P(\frac{Y_n}{b} < \frac{Y_n}{\theta}< \frac{Y_n}{a})=1-\alpha$. Then you can use what you got from (1). Jul 20 '16 at 12:04
  • @PatrickLi Thanks! but what is $P( \frac{Y_n}{\theta}< \frac{Y_n}{a})$ is it $(Y_n /a )^n$? no that can't be. Sorry I am a bit confused how do I use (1) with all the random variables. Do I do $P( Y_n (a - \theta) /(a \theta) < 0 ) = ?$. Jul 20 '16 at 12:13
  
  For a $100(1-\alpha)\%$ two-sided confidence interval, you want to find $a$ and $b$ such that $P(a < \theta < b) = 1-\alpha$. It is equivalent to $P\left(\frac{Y_n}{b} < \frac{Y_n}{\theta} < \frac{Y_n}{a}\right)=1-\alpha$. So $\frac{Y_n}{b}$ will be the $\frac{\alpha}{2}$ percentile of the distribution of $\frac{Y_n}{\theta}$ and $\frac{Y_n}{a}$ is the $1-\frac{\alpha}{2}$ percentile so the area in between is $1-\alpha$.
  
  In (1), you have that the CDF of $\frac{Y_n}{\theta}$ is $y^n$. Then you can have $\left(\frac{Y_n}{b}\right)^n=\frac{\alpha}{2}$ and $\left(\frac{Y_n}{a}\right)^n=1-\frac{\alpha}{2}$. You can solve for $a$ and $b$ as \begin{align*} a &= \dfrac{Y_n}{\left(1-\frac{\alpha}{2}\right)^{1/n}}\\ b &= \dfrac{Y_n}{\left(\frac{\alpha}{2}\right)^{1/n}} \end{align*}
  
  A $100(1-\alpha)\%$ confidence interval for $\theta$ is $\left[\dfrac{Y_n}{\left(1-\frac{\alpha}{2}\right)^{1/n}}, \dfrac{Y_n}{\left(\frac{\alpha}{2}\right)^{1/n}}\right]$.
  
  A simple simulation in R:
  
  > x <- runif(100, 0, 10)
  > max(x)
  [1] 9.924173
  > max(x)/(1-0.025)^(1/100) # lower bound
  [1] 9.926686
  > max(x)/(0.025)^(1/100) # upper bound
  [1] 10.2971
  
  • Thanks again, I guess what confuses me is that $\left[\dfrac{Y_n}{\left(1-\frac{\alpha}{2}\right)^{1/n}}, \dfrac{Y_n}{\left(\frac{\alpha}{2}\right)^{1/n}}\right]$ is a random interval. I mean we don't get a interval of real numbers. Probably I don't understand confidence intervals correctly. Jul 20 '16 at 13:10
  • @Monolite Yes, confidence interval is a random quantity. If you get a different data set, you will have a different interval. But for a given data set, you will have numbers. Jul 20 '16 at 13:13
  • Patrick I was looking at this answer again and I have a doubt: do you mean $\left(\frac{Y_n}{b}\right)^n=\frac{\alpha}{2}$ or $\left(\frac{Y_n}{b}\right)^n=$ the corresponding percentile of $\frac{\alpha}{2}$ ? Sep 3 '16 at 15:57
distilabel_metadata.role: user
distilabel_metadata.raw_output_q_a_detector_0: The text extract is a statistics problem that involves constructing a confidence interval for a parameter \(\theta\) based on a random sample from a uniform distribution. The extract contains a question and a partial answer, specifically:
  
  1. The user provides a solution for the first part of the exercise, which involves proving that the distribution of \(Q = Y_n / \theta\) does not depend on \(\theta\).
  2. The user then asks for help with the second part of the exercise, which is to construct a confidence interval for \(\theta\).
  
  The text also includes a comment from another user providing a hint and a detailed solution to the second part of the exercise.
  
  Label: question-and-answer