New answers tagged

0

i checked it just fast, seems good to me. yt−yt−1≈β0+β1GDPt+β2UPt default rate (my dependent variable) yt delta y; just copied from table: 2021Q1 -0.05 2021Q2 -0.01 2021Q3 0.2 some kind of constant increase/decrease hm 3 different numbers, rate was decreasing alot, then decreased a little, then increased.. maybe.. did u computed coefs b0, b1,b2 after ...


1

I'll give my two cents, though it's far from a "perfect" solution (if one exists). First, as for the issue of varying dataset sizes, you can normalize the token frequencies by the document count, and choose a threshold over the normalized frequency rather than the absolute one. Second, as you noticed, using a threshold in such cases is problematic, ...


2

Let's elucidate this issue using a Venn diagram for the three sets at issue. Let $A$ be the orange circle, let $B$ be the violet circle and let $C$ be the green circle, and denote the probabilities of the intersection-areas in the diagram by $P_1,...,P_7$ (ignoring the area outside the three sets). From this diagram we can see that: $$\begin{align} \mathbb{...


0

Define $$\overline x_{kj}=\frac1{|C_k|}\sum_{i \in C_k} x_{ij} \quad\small,\,j=1,\ldots,p\,;\,k=1,\ldots,K$$ Then looks to me that \begin{align} \sum_{i, i' \in C_k} \sum_{j = 1}^{p} \left(x_{ij} - x_{i'j}\right)^2 &=\sum_{i, i' \in C_k}\sum_{j = 1}^{p}\left\{(x_{ij}-\overline x_{kj})-(x_{i'j}-\overline x_{kj})\right\}^2 \\&=\sum_{i, i' \in C_k}\sum_{...


1

Hints: You can fill in the details! The distribution of the differences $X_1 - X_3$ and $X_2 - X_4$ do not depend on $\mu$, so we can assume $\mu=0$. This reduces to ordinary exponential distributions. The distribution of the difference of two iid exponential distributions is a Laplace distribution. The absolute value of a Laplace distributed random ...


1

If you keep the parameters $n$ and $p$ of the distribution fixed at $n=14$ and $p=\frac 1 4$ then of course the variance will also be constant. You have to vary on of the parameters. I assume that you want $p$ to vary. Then you can plot this variance using the curve function in R. See also its help page (?curve) for more details. curve(14 * x * (1 - x), ...


2

You were on the right track. But the likelihood is simpler than what it looks in your post. If $\boldsymbol X_i=(X_{ij})_{1\le j\le n}$ for every $i$, then $\boldsymbol X_i$'s are i.i.d $N_n(\mu\mathbf1_n,\Sigma)$ with $$\Sigma=\sigma^2 I_n + \tau^2\mathbf1_n\mathbf1_n^T$$ So joint pdf of the $X_{ij}$'s is joint pdf of the $\boldsymbol X_i$'s, given by \...


0

Looking at the ELBO equation in Andrew Ng's course, we have a model p representing the data generation process from latent to observable, and an approximation of this model with Q. The ELBO aims to optimise a function such that Q is as close to p as possible, thus giving Q a good fit of p. This is what the argmax in the M-step finds, the distance here is a ...


4

If the aim is not just forecasting but trying to get a good handle on which predictors are most important in some sense, in my view PCA is likely to be a distraction and its use to turn out to be a detour. You would be better off applying some flavour of regression directly. That is unlikely to be trivially easy and selection of predictors is a deep and ...


0

You could answer your boss's question in focusing on the PCs that best explain the variance of your dataset (as suggested above). Then, you could decompose those PCs in combinations of your initial variables. The coefficients in front of the variables will tell you how strongly they influence the variability.


0

Yes and no. PCA doesn't replace anything with latent variables you might be thinking of factor analysis (FA). PCA does construct principal components (PC) which are linear combinations of all the variables. If for example you were to find that the first PC explains 90 % of the variability, you could focus on this PC and check which variables mostly ...


4

Intro Let us start with some notation: We have $m$ simple hypotheses we test, with each null numbered $H_{0,i}$. The global null hypothesis can be written as an intersection of all the local nulls: $H_0=\bigcap_{i=1}^{m}{H_{0,i}}$. Next, we assume that each hypothesis $H_{0,i}$ has a test statistic $t_i$ for which we can compute the p-value $p_i$. More ...


0

Firstly, your sufficient statistic must be a statistic ---i.e., it is a function of the data but it cannot depend on $\theta$. You figure out the sufficient statistic by first writing out the likelihood function for a full data vector and stripping it down to the parts that depend on the parameter: $$\begin{align} L_\mathbf{x}(\theta) &= \prod_{i=1}^n ...


0

Hint: Look at the likelihood ratio $$ \text{LR}=\prod_i \frac{(2/\theta^2)(\theta-x_i)\cdot \mathbb{1}_{(0,\theta)}(x_i)}{(2/\psi^2)(\psi-x_i)\cdot \mathbb{1}_{(0,\psi)}(x_i)} $$ defined for $\max_i x_i < \min(\theta, \psi)$. Use that the likelihood ratio is a function of any sufficient statistic. The above can be simplified to $$ \text{LR}=\frac{\psi^2}{\...


2

Let’s define $\Sigma$ as the covariance matrix. You did $\dfrac{\Sigma}{\sigma_X\sigma_Y}$. In other words, divide each entry of the matrix by the standard deviations. This is not correct for the diagonal elements. The diagonal elements should be divided by the variance of the corresponding random variable, so $\sigma_X\sigma_X$ for the top left and $\...


10

Use your original data. Claims about losing power when groups have unequal sizes make more sense in the context of designing the experiment. If you have enough resources to make $100$ observations, the greatest power will be when you allocate $50$ to the control group and the other $50$ to the treatment group. However, $150$ in the control group with $50$ in ...


0

I do not know how to use the factorization theorem You have to write the likelihood as a product of two functions. One function is allowed to have parameters in it, and one is not. The one with the parameter in it will have the sufficient statistic in it. Also, How can I express this density function as an exponential family? I have problems with the ...


1

The two statements : $$\left(\sqrt{n}(X_n - c) \overset{D}{\to}\mathcal{N}(0, 1)\right) \Longrightarrow \left(\sqrt{n}(g(X_n) - g(c)) \overset{D}{\to}\mathcal{N}(0, g'(c)^2)\right) $$ and $$\left(\sqrt{n}(X_n - c) \overset{D}{\to}\mathcal{N}(0, \sigma^2)\right) \Longrightarrow \left(\sqrt{n}(g(X_n) - g(c)) \overset{D}{\to}\mathcal{N}(0, g'(c)^2\sigma^2)\...


0

The most accessible theoretical demonstrations may be linked in the second Comment of @SextusEmpiricus and in @whuber's link. Hoping that $n = 100$ is large enough to see a suggestive approximation of the ratio $2/\pi$ (for normal data), perhaps the following simple simulation in R of $10^5$ samples of size $n=100$ might give a view of this fact. set.seed(...


4

Partial results Below is a trial by comparing the sum of Pareto variables (with $\alpha = 0.5$) with a Levy distribution. The shifting and scaling are done based on the median and interquartile range. The convergence is not very fast but it does seem to work. ### function to get a scaled sample mean require(actuar) sum_sample = function(n,s) { a_n = n^(-...


1

Why can't I estimate $\beta_{0}$ and $\beta_{1}$ by optimizing the sum of residuals such that the sum is equal to zero ? You can find some $\beta_0$ and $\beta_1$ such that $\sum_{i=1}^n \epsilon_i =0$ but the solution won't be unique and it is also not meaningfull. The image below shows an example with two points. By tilting the line you can increase ...


1

Some empirical assertions if there are $n$ terms and $Y_n = \frac{\sum_1^n{X_i}}{\sqrt{\sum_1^n{X_i^2}}}$ with the $X_i$ iid $N(0,1)$: $Y_n$ has expectation $0$ and variance $1$ $Y_n$ has support on $[-\sqrt{n},\sqrt{n}]$ (unless $n=1$, in which case the support is just $\{-1,1\}$) The density for $Y_n$ on its support is proportional to $(n-y^2)^{(n-3)/2}...


1

Hint: you can rewrite $\sum x_i^2 = \bar{x}^2 + \sum (x_i -\bar{x})^2$. Note that the terms $n\bar{x}^2$ and $\sum (x_i -\bar{x})^2$ are independent chi-squared distributed variables. Then you can rewrite $Y = \frac{\sum{x_i}}{\sqrt{\sum{x_i^2}}}$ as $$\begin{array}{} Y^2 &= &\frac{\left(\sum{x_i}\right)^2}{{\sum{x_i^2}}}\\ &=& \frac{n^2\bar{...


0

The main difference between the paper and the exercise is the following: in this exercise, one has to ensure that exactly $n$ samples are drawn from $\omega_1$ and exactly $n$ samples are drawn from $\omega_2$. In the paper, each time a sample is to be drawn, a coin is flipped and if it's heads the sample is drawn from $\omega_1$ and if it's tails the sample ...


1

Here is a list of point forecast accuracy measures. The entire textbook is very much recommended. Also relevant: MAPE vs R-squared in regression models What are the shortcomings of the Mean Absolute Percentage Error (MAPE)? Mean absolute error OR root mean squared error? There is a number of normality tests, the most common is the Shapiro-Wilks test. In 15 ...


0

The indefinite integral you have provided, $\theta_0$, involves two parameters $\beta_0$ and $\beta_1$ and the random term $\epsilon_i$. Hence $\theta_0$ is random. Then you say you want to find the MLE or a consistent estimator of $\theta_0$. You cannot find the MLE of an random quantity, you can only find the MLE of parameters (unknown constants) in a ...


2

By "the skewness" I guess you mean the moment-based skewness calculated from third and second powers of deviations from the mean. But there are other ways of thinking about skewness that perhaps come closer to what you seek. You can measure skewness by a measure using mean, median and standard deviation (SD): (mean $-$ median) / SD Like any other ...


0

Generally it is considered better to fit one model using all of the groups, and then do post-hoc tests afterwards. This will give a consistent analysis, and is generally more powerful. Some similar questions with answers: One predictive model for all data vs subject/group specific models How to test whether linear models fit separately to two groups are ...


0

In the definition of the conditional density $$f_{X|Y}(x|y) = \dfrac{f_{X,Y}(x,y)}{f_Y(y)}$$ both $f_{X,Y}(\cdot,\cdot)$ and $f_Y(\cdot)$ are densities wrt some appropriate dominating measures. You need to find the proper dominating measure for $(X,Y)$ when $Y=\mathbb I_{X>5}$.


2

That's a legitimate concern. But since $\hat\beta_\lambda$ is a linear combination of the response $y,$ the explanation ought to go back to $y,$ thus: $$\hat\beta_\lambda = (X^\prime X + \lambda)^{-1} X^\prime y.$$ Recall that (conditional on $X$) the components of $y$ are independent (and therefore uncorrelated) variables with common variance $\sigma^2.$ ...


3

There's no error. Start with $X^\top X = (X^\top X+\lambda I) - \lambda I$; premultiply both sides by $(X^\top X+\lambda I)^{-1}$. Simplify. Postmultiply by $\beta$


1

$$\bigg(\frac{s}{t}\bigg)^k\bigg(1-\frac{s}{t}\bigg)^{n-k}$$ $$=\bigg(\frac{1}{t}s\bigg)^k\bigg[\frac{1}{t}(t-s)\bigg]^{n-k}$$ $$=\bigg(\frac{1}{t}\bigg)^ks^k\bigg[\frac{1}{t}\bigg]^{n-k}(t-s)^{n-k}$$ $$=\bigg(\frac{1}{t}\bigg)^ns^k(t-s)^{n-k}$$ $$=\bigg(\frac{1}{t^n}\bigg)s^k(t-s)^{n-k}$$ $$=\frac{s^k(t-s)^{n-k}}{t^n}$$ Let me know if I have made any ...


0

Let's do an example. I'm going to flip a fair coin ten times. The expected number of heads is $5$. In statistics-speak: $$ X \sim Binom(n=10, p=0.5) $$ I do the flips and get the unusual result of $9$ heads and $1$ tail. Now let's do it again. The expected number of heads is still five. That's regression to the mean. But wouldn't you expect any future point ...


1

It's a fairly loose concept, it applies in some situations and not others, depending on the assumptions & underlying distribution. But wouldn't you expect any future point to likely "be close to the mean" regardless simply because that's the expectation value of the rv? Yes, if all RVs come from exactly the same distribution. What does this ...


0

You cannot directly observe $\epsilon_i$. Statisticians make an assumption that these errors are iid $N(0, 1)$. So "optimizing" to reduce that to zero doesn't quite make sense to me. Finding an estimator such that $\sum\limits^n_{i=1} (y_i - \beta_0 + \beta_1 x_i) =0$ may not have a unique solution. As whuber pointed out, minimizing this also does ...


1

Are the position indices (quartiles, median, mean) of distribution in classes always different from those of the unit distribution? If so, for what reason? In theory, since the class distribution is a summary, they should never be the same [...] We are talking about comparing sample estimates to estimates obtaining aggregated data from a histogram. As you ...


1

Think about adding the powers of matrix. For example the following identity holds: $\mathbf{A}^{a}\mathbf{A}^{b} = \mathbf{A}^{a + b}$ Applied to your problem: $\mathbf{A}^{0.5}\mathbf{A}^{0.5}\mathbf{A}^{-1} = \mathbf{A}^{0} = \mathbf{I}$


-1

The part of unexplained variance is the variance of the residuals ($\hat y - y$) of your regression / total variance - that's $1-R^2$. If you know for sure that your hypothesis function is relevant and well-fit to your data (eg in the case where you generated the data yourself), the unexplained variance will be noise only. On your figure, for each point, the ...


2

Both are correct based on which layout notation (i.e. numerator or denominator) is being used. Unfortunately, this is not explicitly stated in most sources and you need to infer it.


1

With ANOVA you compare the variance of the difference between the group means and the variance of the differences within the groups. For the comparison of variance it doesn't in principle matter what distribution you have. If the distributions are the same then the distribution of the means has the variance of the distribution of the individuals divided by $...


5

When you use the values of the normal density then you get automatically the first four conditions satisfied $$P(X = x\vert \mu,\sigma,a,b,c) = \frac{e^{-\frac{(x-\mu)^2}{2\sigma^2}}}{\sum_{y \in \Omega} e^{-\frac{(y-\mu)^2}{2\sigma^2}}}$$ where $\Omega = \lbrace a,a+c,a+2c,\dots b-c,c \rbrace$ all the values in the support. Maximum entropy The fifth ...


5

The other answer here uses the normal density values at the exact points. Another similar method would be to take the normal probabilities across intervals centred on those points. In the latter case, taking the support to be $X = 1,...,m$ you get: $$p_X(x) = \frac{\Phi \Big( \frac{x - \mu + 1/2}{\sigma} \Big) - \Phi \Big( \frac{x - \mu - 1/2}{\sigma} \Big)...


1

You can run an ANOVA and then do a post-hoc comparison. With only two observations per group there needs to be decent size differences between the groups. You can also run Dunnet's Test to compare all three against the control. See code below. There is no minimum rule sample size such as 3. All depends on the effect size you're trying to detect. library(...


1

First, the sample variance of a sample of size 2 may not be the best estimate of the population variance, but it does exist, so your model with 2 replications per level of a one-factor experiment should work according to the usual formulas. in R: y = c(16, 18); var(y) [1] 2 I input your data as follows (please proofread): x = c(16,18, 20,17, 25,27, 23,21) ...


2

By the law of iterated expectation, we can write $$E[(y - E[y|x])(E[y|x] - E[y])] = E[E[(y - E[y|x])(E[y|x] - E[y]) | x]]$$ Thus, to show that the LHS is 0, it suffices to show that the conditional expectation on the RHS is 0 for each fixed value of $x$, because $E[0] = 0$. So we just need to show that $$E[(y - E[y|x])(E[y|x] - E[y]) | x]$$ What is special ...


2

Consider the model $$Y=X\beta+\varepsilon\,,$$ where $Y$ is an $n\times 1$ response vector, $X$ is an $n\times p$ matrix of covariates (fixed) with full column rank, $\beta$ is a $p\times 1$ vector of parameters and $\varepsilon$ is an $n\times 1$ error vector. Also assume $n>p$. The residual sum of squares is then $$\text{RSS}=(Y-X\hat\beta)^T(Y-X\hat\...


1

the solution of weighted least squares problem with diagonal weight matrix $W_m$ and working responses $X_i^T\beta_m+U_i(\eta_m)/w_{m,j}$. ... Working responses what does that mean? The working response is the response $Y_{m,i}$ in the weighted least squares problem during the current step $$\min_{\beta_{m+1}} W_{m,i} (Y_{m,i} - X_i^T\beta_{m+1})^2 $$ This ...


0

I actually do not know how to do this exactly, but you can write $U(\beta)\approx U(\beta_0)+(\beta-\beta_0)U'(\beta_0)$ (Taylor expansion). Note the similarity to your second to last display. Now take this and solve for $(\beta-\beta_0)$ and pull $\beta_0$ onto the other side, and note the similarity to your last display. You must show that the solution ...


Top 50 recent answers are included