New answers tagged

1

You have $$ D_{KL}(p_{data} \parallel p_{model}) = \int_{-\infty}^{\infty} p_{data}(x) \log \frac{p_{data}(x)}{p_{model}(x)} dx $$ and $$ D_{JS}(p_{data} \parallel p_{model}) =\frac{1}{2}D_{KL}\Big(p_{data} \parallel \frac{1}{2} (p_{model}+p_{data})\Big)+ \frac{1}{2}D_{KL}\Big(p_{model} \parallel \frac{1}{2} (p_{model}+p_{data})\Big) $$ It is ...


4

The posterior expectation writes as \begin{align*}\mathbb E^\pi[\theta|x]&=\dfrac{\mathbb E^\pi[\theta^2x+\theta(1-\theta)(1-x)]}{\mathbb E^\pi[\theta x+(1-\theta)(1-x)]}\\ &=\dfrac{\mathbb E^\pi[2\theta^2 x-\theta x +\theta-\theta^2]}{\mathbb E^\pi[2\theta x+1-\theta-x]}\\ &=\dfrac{\mathbb 2\frac{3}{8} x-\frac{1}{2} x +\frac{1}{2}-\frac{3}{8}}{2\...


0

Data: Suppose you have a sample of size $n = 10$ from $\mathsf{Beta}(3, 1),$ so that $\theta = 3.$ Sample simulated in R: set.seed(305) n = 10; x = rbeta(n, 3, 1) summary(x); sd(x) Min. 1st Qu. Median Mean 3rd Qu. Max. 0.6086 0.6916 0.8535 0.8052 0.9031 0.9581 [1] 0.1241171 # sample SD The MLE $\hat \theta = n/W =10/W = 4.388208,$ w = -...


0

Staying at the image, in the square brackets of the first 3 columns there are the p-values for hypothesis referred on 3 parameters each. For example in position $[1,1]$ we have $[0.211067]$ that is about significance of DLCONS lag1 parameters, valid for the 3 dependent variable jointly. In the last column we have the test about the lag of order $i=1,2,3,4,5$ ...


4

I think whoever wrote the question is causing you additional confusion by conflating two concepts. The term "quantitative variable" (which is not a term I've ever really heard before) is especially confusing/ambiguous, since it's not clear whether it's referring to the kind of data stored in the variable or what that represents. Firstly, in a ...


1

A quantitative variable is one whose values can be measured on some numeric scale. Some examples in your dataset are price, bedrooms and bathrooms. Note that all these share numeric relationships to one another e.g. $10 > 6 > 4$ and $10 = 6 + 4$. A categorical variable is one who just indicates categories. It's values don't have any numeric ...


0

Here is a crude R code comparing composition versus inversion for a mixture of $K$ exponential distributions: library(rbenchmark) #target creation K=100 we=sort(runif(K),d=T) #mixture weight we=we/sum(we) wes=cumsum(we) #cumulated sum la=rexp(K) #expomential rates lah=median(la) F=function(x)sum(we*exp(-la*x)) #tail cdf benchmark("compo"={ #...


2

In general, you should not be concerned about efficiency (performance) between random variate generation methods, unless you have written an implementation of them, compared their running time, used them in your application, and found the running time to be unacceptable in your application. This is a general issue in programming that is obviously not limited ...


4

Although you can do this with mindless application of definitions and skill at integration, the interest (and challenge) is to obtain an answer with as little work (and as much insight) as possible. Upon reflection, it looks like this problem ultimately requires only the following facts: By inspection of the exponent $(x-1)^2 = (x-1)^2/(2\sqrt{1/2}),$ $X$ ...


1

It's related with theory of queues from its definition if we read the Queueing Theory and Markov Property whats about:. You can think of a queue or a queue node as almost a black box. Jobs or "clients" arrive in the queue, possibly wait some time, take some time to process, and then exit the queue. However, the tail node is not a pure black box, ...


2

The exact answer is that under random guessing, the number correct is $X \sim \mathsf{Binom}(50, .5).$ As you say, you seek $P(X \ge 35) = 1 - P(X \le 34) = 0.0033,$ as computed in R, where pbinom is a binomial CDF. 1 - pbinom(34, 50, .5) [1] 0.003300224 It seems you are asked to use a normal approximation. The approximating normal distribution has $\mu = ...


1

You are looking at a multivariate binomial distribution where all the variables are independent. The ML may be calculated for each variable separately. Consider the $i$ variable and let $\theta_1 = p$. Let $y_1,\ y_2 \ \dots,y_n$ be a random sample of size $n$ from this distribution. Then let $j=\sum_{k=1}n y_k$. Then you may show that the Liklihood ...


1

Most surprisingly, this question and its resolution appear in a question asked by the OP five years ago, in connection with a paper of Gopalan et al. (2015). As I have written my answer before realising this duplicate existed, I'll keep it posted (if only because the original post found no answer at the time). If$$N_{w,d}\sim\mathcal P(\sum_{1\le k\le K} \...


1

The better formula for estimating acceptance rate is $$ \text{acceptance rate} = \frac{1}{T} \sum^T_{s=1} \mathbb{I}(\boldsymbol{\theta}^{(s)} \text{accepted}) $$ because it includes more samples. Given you have 5000 samples after thinning, it should not really matter which formula you use, though. It can be a good idea to compute the acceptance rate using a ...


2

Since it's self-study, I won't give you the full answer. But use the facts: The dot product is bilinear, namely for any scalar $\lambda$ and any two points $a,b\in\mathcal{X}$ $$\langle \varphi(a)+\lambda\varphi(b),\varphi(x)\rangle = \langle \varphi(a),\varphi(x)\rangle + \lambda\langle \varphi(b),\varphi(x)\rangle$$ The linearity generalizes to any finite ...


0

I show the two random variables have the same distribution by showing that they have the same CDF. Let $T_1=X/Y$ and $T_2=X/|Y|$. \begin{align} F_{T_1}&=P(X/Y<t)=P(X<Yt, Y>0).P(Y>0) +P(X>Yt , Y<0).P(Y<0)\ \\ F_{T_2}&=P(X<|Y|t)=P(X<Yt, Y>0).P(Y>0) +P(X<-Yt , Y<0).P(Y<0) \end{align} Since $X$ is symmetric ...


2

From the range of your uniform distribution, you can see that $T(\mathbf{x}) = \max_{i=1,...,n} |X_i|$ is going to be the minimal sufficient statistic. To demonstrate sufficiency formally, we note that the likelihood function reduces to: $$\begin{align} L_\mathbf{x}(\theta) &= \prod_{i=1}^n \text{U}(x_i| -\theta, \theta) \\[6pt] &= \prod_{i=1}^n \...


1

Just to spell out the complete argument, consider the transform \begin{align*}\Psi:& \qquad\mathbb R^n \quad\longmapsto \quad\mathbb R\\ &(x_1,\ldots,x_n) \mapsto x_1-x_2 \end{align*} Then $\mathbb E[\Psi(X_1,\ldots,X_n)]=\mathbb E[X_1-X_2]=0$ and the iid sample $(X_1,\ldots,X_n)$ cannot be complete since $\Psi(X_1,\ldots,X_n)$ is a non-zero function ...


2

Guessing from the R code and the question it sounds like one observed $$X\sim\mathcal P(\lambda)$$ as $x=60$ and the prior distribution on $\lambda$ is a Gamma distribution $\mathcal Ga(a,b)$ [using the scale parameterisation of the Gamma distribution] meaning the posterior distribution is indeed $$\mathcal Ga(a+x,b/(b+1))$$ Running a Metropolis-Rosenbluth-...


5

This is a case where you are confusing yourself with incorrect use of notation. The function $F_X: \mathbb{R} \rightarrow [0,1]$ describes the distribution of the random variable $X$, but it does not use this random variable as an implicit or explicit argument. From the probabilistic definition of the CDF, for all $x \in \mathbb{R}$ we can validly say that:...


0

For any random variable $X$, and any function $g$ defined on $\mathrm{Supp}(X)$ the support of $X$, you can create a new random variable $Y=g(X)$. This variable is random because $X$ is. The CDF $F_X$ maps the set $\mathrm{Supp}(X)$ to the interval $[0,1]$. Think of $F_X$ as some function. You can set $g = F_X$ in my example. Your notation is indeed ...


1

In your second approach, you mix ordered and unordered (i.e. distinguishable and indistinguishable) things (balls, boxes). I have in total $5$ boxes. I know that so far I have placed 4 balls in these 5 boxes. So, the total number of ways to do that is $5^4$. Sure, but it means that you supposed the balls and boxes are labeled (ordered, distinguishable): ...


1

In the second approach, possibilities include not only the fourth ball in the occupied box but also the others, e.g. balls 2 and 3. An correct example way of calculating by counting is: First choose three boxes, and put the balls into them in some order: ${5\choose 3}3!$ Pick one of the occupied boxes and put the fourth one: ${3 \choose 1}$ That makes $$\...


2

Theorem 7.5 from here. $$\sum_{n=1}^{\infty}P[|X_{(n)}-2|>\epsilon]=\sum_{n=1}^{\infty}P[X_{(n)}<2-\epsilon] =\sum_{n=1}^{\infty}\left(\frac{2-\epsilon}2\right)^n=\frac{2-\epsilon}{\epsilon}$$


3

Hint: Let $J=\mathbf{1} \mathbf{1}^T$ be the matrix (of size $n\times n$) where all components are 1 and $\mathbf{1}$ is the column vector of only 1's. Then we have $\Sigma = \rho J + (1-\rho) I$. By manipulating $\Sigma$ in this form you can solve by hand!


2

As you know any function of a CSS is a UMVUE of its expected value. We wish to find a function of the CSS that has expected value desired. So $$\begin{split}E(g(Y))&=\frac{\theta}{1+\theta}\\ \int _0^\theta g(y)\frac{ny^{n-1}}{\theta^n}dy&=\frac \theta {1+\theta}\\ n\int _0^\theta g(y)y^{n-1}dy&=\frac{\theta^{n+1}}{1+\theta}\\ n\left[g(\theta)\...


3

The way I understand the Tobit model, you either observe $y_i$ when $y_i>0$ or the fact that $y_i<0$ but not the precise value of $y_i\sim\mathcal N(x_i'\beta,\sigma^2)$. (This means $y_L=0$ in the Wikipedia page.) Thus, the distribution of the data, made of the $$y_i\mathbb I_{y_i>0}\qquad i=1,\ldots,n$$is mixed, with a continuous component when $y&...


2

Note: there was a typo in the question (but not in the original exercise) that I did not want to correct as it would have changed the meaning of the question: $$\left(\frac{i-\min(x_i)}{i}, \frac{\max(x_i)-i}{i}\right)$$ was replaced with $$\left\{-\min([x_i-i]/i), \max([x_i-i]/i)\right\}$$ as the extrema applies to all terms involving $i$ at once. The ...


3

Wrong statements: Any sufficient statistic which is a function of yet another sufficient statistic is called a minimal sufficient statistic. view the statistic $T_2(X)$ as a function of $T_1(X)$ any one of one function of sufficient statistic is sufficient sufficient for the same parameter or transformed parameter Corrected statements: A sufficient ...


0

I'll add that you can replace the progress bars, which don't illuminate all that much, with an iteration count instead with this: x2.d[i] = Mclust(x2, G=2, verbose=FALSE)$loglik - Mclust(x2, G=1, verbose=FALSE)$loglik x1.d[i] = Mclust(x1, G=2, verbose=FALSE)$loglik - Mclust(x1, G=1, verbose=FALSE)$loglik cat(sprintf("\rIteration %s of %s (%.1f%% ...


2

To answer the question about correlation, we can note that $\frac{X_{(1)}}{X_{(n)}}=\frac{X_{(1)}/\theta}{X_{(n)}/\theta}=\frac{Y_{(1)}}{Y_{(n)}}$ where $Y_1,\ldots,Y_n$ are i.i.d uniform on $(0,1)$. As such the distribution of the ratio is free of $\theta$, hence it is an ancillary statistic. Moreover $X_{(n)}$ is a complete sufficient statistic for the $U(...


3

Perhaps if you treat it as a mixture of two distributions. 1: $$ F1(x)=1(x>=5) $$ F(x) =1 if X>=5 but zero otherwise. 2: $$ F2(x)=1-e^{-7x} $$ The mixture: $$F(X) = 0.5 * F1 + 0.5* F2 $$ $$F(X) = 0.5 * 1(x>=5) + 0.5*(1-e^{-7x}) $$ HTH UPDATE. So the answer above corresponds to the original question. However, given the latest information, the answer ...


2

You need the joint distribution of $X_{(1)}$ and $X_{(n)}$. see here for the derivation in the case of Unif(0,1). The joint density is $$f_{X_{1},X_{n}}(u,v)=n! \frac{(v-u)^{n-2}}{(n-2)!} \theta^{-n}$$ You can find the expected value of any function of the two random variables by integrating the function of $u$ and $v$ over the two-dimensional integral with ...


1

The confusion stands with the simultaneous use of $x$ and $x^{(i)}$: the $x^{(i)}$'s are iid from $q(\cdot)$ and hence what need be checked is that \begin{align} \mathbb{E}_{q}[u(x)] &= \mathbb{E}_{q}\left[ \frac{p(x)}{q(x)} \right] \\ &= \int_{\mathbb R^D} \frac{p(x)}{q(x)} q(x) \text dx\\ &= \int_{\mathbb R^D} p(x) \text dx \\ &= 1 \end{...


3

This is correct. It is, however, nice to have a numerical algorithm to solve the problem when the number of states grows large. There's a simple one. The matrix $\mathbb A = (a_{ij})$ having ones where $\mathbb P$ is nonzero and otherwise having zeros is the adjacency matrix of the Markov chain. That is, for any states $i$ and $j,$ $a_{ij}=1$ means there ...


2

You can refer here for the methodology, and for an explicit formula for 2D case, as in yours. You have $H_1(x_1,x_2)=x_1+x_2$ and $H_2(x_1,x_2)=x_1/x_2$. You'll invert these two functions, i.e. find $x_1=H_1^{-1}(y_1,y_2),x_2=H_2^{-1}(y_1,x_2)$ and apply the formula given in the wikipedia page.


3

Rather than trying to guess the answer, one can apply probability laws. Since the transition matrix $\mathsf P$ is made of the probabilities $\mathbb P(X_t=j|X_{t-1}=i)$ as $(i,j)$ entries, the probability $\mathbb P(X_{t-1}=j|X_{t}=i)$ can be written as$$\mathbb P(X_{t-1}=j|X_{t}=i)=\dfrac{\mathbb P(X_t=i|X_{t-1}=j)\mathbb P(X_{t-1}=j)}{\mathbb P(X_t=i)}$$...


1

You have probably figured this out by now. In any case, the joint density factors as $$f(x,y)=\underbrace{\frac1{2y}\mathbf1_{|x|<y}}_{f_{X\mid Y}(x\mid y)}\cdot\underbrace{\sqrt{\frac2{\pi}}e^{-y^2/2}\mathbf1_{y>0}}_{f_Y(y)}$$ So $X$ conditioned on $Y=y$ is uniform on $(-y,y)$ for $y>0$ and $Y$ itself has a folded normal distribution. This is ...


1

General sample size formula. Let $\sigma$ be the normal population standard deviation and let $\Delta = |\mu_0 - \mu_a|$ be the difference to detect in a one-sided test. Then the general formula for Type II error $\beta$ a test at level $\alpha$ is to use a sample of size $n = \frac{\sigma^2}{\Delta^2}(z_\alpha + z_\beta)^2,$ where $z_\alpha$ and $z_\beta$ ...


0

These are not the usual assumptions for linear regression. $\bar{X}$ is not usually assumed to have a normal distribution. The $X_i$ are assumed fixed. $Var[Y_i]$ is assumed to be $\sigma^2$. I don't know what $u_i$ means. Also, I don't know what it means to use subscripts $i$ in the formula for the variances without a summation symbol. $$E[\hat{\beta_0}-\...


0

The square root transform is the so called "variance stabilizing" transform of a Poisson distributed random variable. The Delta Method states: So you can easily derive the square-root function of the parameter, square it, and multiply the result by the known variance of a Poisson distributed random variable to obtain a constant variance.


2

Your answer to question 2 is correct, provided here are actually individuals with $y \geq 85$. The easiest way to see this is that this truncation would at the very least decrease the mean value of $y$, so even if you cooked up the data in such a way that $\beta_1, \beta_2$ from such a regression stayed exactly the same, then $\beta_0$ would still have to ...


4

Short answer: Not really. Long answer: In theory, you should randomly sample your observations from the "population". However, when your population consists of humans (as opposed e.g. of bacteria), this might be hard to achieve. Humans have their own free will and might decline to participate in your study. For that reason, social scientists and ...


1

$P(\text{Item defective and Test says defective})\neq P(\text{Item defective})P(\text{Test says defective})$ because these events are dependent. Let's rename the events as $D$: item defective, $TD$: test says defective. We want to find $P(D|TD)$, which is $$P(D|TD)=\frac{P(D\cap TD)}{P(TD)}=\frac{P(TD|D)P(D)}{P(TD)}$$ $P(D)$ and $P(TD|D)$ are already given ...


1

In your solution, you account for distinguishable rooms and indistinguishable people. It should have been the other way around. Consider assigning each person to east or west, where the room numbers don't matter. If there were plenty of rooms both side, we'd have $2^4$ choices in total, e.g. $\{WWWW,WWWE,...,EEEE\}$. All but one of them is possible (i.e. $...


Top 50 recent answers are included