New answers tagged

2

I imagine that people could come up with a justification for the two step approach, but to me, it seems like a bit of a waste. Most critical from my perspective, if you run everything in a single model, $logit(p(y_{it}=1))=\beta_0 + u_{0i} + (\beta_1 + u_{1i})x$ then the $u_{0i}$ and $u_{1i}$ remain latent variables, thus reducing measurement error that is ...


0

One of the libraries in R has a runs.test procedure, which you can explore. My purpose here here is to give an idea how looking at runs can help you decide whether your observations are randomly sampled from the same population. To begin we look specifically at sequences of Bernoulli trials, as mentioned in your Question. (Randomness tests for other ...


0

In classical estimation theory, i.e. estimation of non random parameter, an efficient estimator is one that is unbiased and achieves the CRLB for the parameter estimated. CRLB gives a lower bound on the variance of the estimator i.e. no estimator in the classical estimation setting can ever have a variance less than the CRLB. If luckily we can come up with ...


2

The integral $\int_0^1 \int_x^3 f(x,y) dy dx$ corresponds to this picture, where we integrate along $y$ first from the values $y = x$ to the values $y = 3$. The integral $\int_0^3 \int_0^{g(y)} f(x,y) dx dy$ where $$ g(y) = \begin{cases} x, & \text{ if } y < 1 \\ 1, & \text{ if } y \ge 1 \end{cases} $$ corresponds to this picture, where we ...


0

A few moments after posting this, a colleague directed that there are different coefTest docs for different linear models (e.g., lme, glme, etc.). Upon reading the correct help doc, the contrast should only be a vector (not a matrix). As such, a simple change to coefTest(Model,[1 0 0 1.34 0 0 -1 0 0 0 0 (-1*1.34) 0 0] - [1 0 0 1.34 0 0 1 0 0 0 0 (1*1.34) 0 0]...


1

Assuming that any convenient parametrizable sort of correlation suffices, here is a workable model whose details you can flesh out. A straightforward way to generate correlated standard-normally distributed variables is via a Cholesky decomposition. Various instructions can be found for this online or in CrossValidated. See, for example, How to use the ...


0

I think it's all typos. The Eq (10.107) is $$\begin{align}\mathcal{L}(q)&=\mathbb E_w[\ln p(w,\alpha,t)]-\mathbb E[\ln q(w,\alpha)]\\&=\mathbb E_w[\ln p(t|w)]+\mathbb E_{w,\alpha}[\ln p(w|\alpha)]+\mathbb E_\alpha[\ln p(\alpha)]-\mathbb E_\alpha[\ln q(w)]_w - \mathbb E[\ln q(\alpha)]\end{align}$$ The last two terms in the second line are apparently ...


1

In the Bayesian paradigm, distributions of interest are uncertainty distributions of unknown parameters. So if you have a posterior distribution $f(\theta)$ for parameter $\theta$ you can get an uncertainty (credible) interval for $\theta$. This interval is "summary measure agnostic" since it does not refer to the use of a point estimate summary ...


2

It means, if you take several datasets of size $N$, calculate mean and variance estimates for each of them and then take the average, you'd obtain $\mu$ and $\frac{N-1}{N}\sigma^2$


0

variance estimation via samples - converges to the real variance with a lot of samples. closed formula for variance is little bit harder. It is possible only if you use a conjugate prior. In this wiki you will find formulas for the posterior distribution, given some prior - for example gamma dist is the conjugate prior for Poisson dist. the gamma dist itself ...


0

If the goal is to rank the estimates according to the magnitude of the point estimates, that seems simple. It is unclear from what you say how or why the the confidence intervals (CIs) should be involved in the ranking. If the concern is that some CIs are longer than others, so that the order of ranking of the true population means might be different, you ...


0

Have you considered ranking them on the absolute value of their $t$-statistics? Or is there something deeper that I missed?


0

You could look at your problem from a slightly different perspective. Theorem. Let $y\sim N_n(0,\sigma^2 I_n)$ and let $Q=\sigma^{-2}y′Ay$ for a symmetric matrix $A$ of rank $r$. Then if $A$ is idempotent, $Q$ has a $\chi^2(r)$ distribution. Proof. See Mathai & Provost, Quadratic forms in random variables, New York: Marcel Dekker, 1992, p.~196, or ...


0

Normal data with $\mu$ and $\sigma$ both unknown. If you know that the population is $\mathsf{Norm}(\mu=0,\sigma),$ then there is no point estimating $\mu$ by $\bar X.$ Furthermore, if you then ignore $\bar X,$ the distribution theory as a little different, using $\mathsf{Chisq}(\nu=n)$ instead of $\mathsf{Chisq}(\nu=n-1).$ Normal data with $\mu$ known and $\...


3

The answer is no. Distributions can be differently higher/lower in relation to each other for different moments. Example Consider the distribution $$f(x,a) = \begin{cases} 0.075 & \text{if} & x = -a \\ 0.175 & \text{if} & x = -1 \\ 0.500 & \text{if} & x = 0 \\ 0.175 & \text{if} & x = 1 \\ 0.075 & \text{if} & x = a \\ \...


0

It sounds like you are looking to produce an interval that captures some proportion of relative prediction errors, and NOT a confidence interval. For clarity, a confidence interval should be understood as a means to quantify uncertainty about the value of a parameter in a statistical model. To provide an interval that captures $P$% of your relative ...


1

It is informative to see exactly what the Mann-Whitney test does. For two samples $X = \{x_1, \dots, x_m \}$ and $Y=\{y_1, \dots, y_n\}$, under the assumptions that Observations in $X$ are iid Observations in $Y$ are iid The samples $X$ and $Y$ are mutually independent. The respective populations from which $X$ and $Y$ were sampled are continuous. then, ...


5

Neither The Mann-Whitney(-Wilcoxon) $U$ test is typically a test of $\text{H}_{0}\text{: }P(X_{A} > X_{B}) = 0.5$, rejected in favor of $\text{H}_{\text{A}}\text{: }P(X_{A} > X_{B}) \ne 0.5$. In plain language: the probability that a randomly selected observation from group $\text{A}$ is greater than a randomly selected observation from group $\text{B}$...


2

The Wilcoxon Mann-Whitney two-sample rank sum test tests whether observations from one group tend to be bigger than observations from another group. It is used for ordinal or continuous response variables Y and not for the case where Y is binary or represents unordered categories. But if Y were binary the p-value from the Wilcoxon test, though not very ...


1

The decision to aggregate your observations at the minute, hour, day, week or month level depends on your context. Suppose that what you're interested in is the effect of a covariate on a given outcome, aggregating the data kills the variability in your treatment and your outcome that comes within the unit of aggregation. At the end, what matters is the ...


3

As Larry suggested in another answer, a simple correlation might be sufficient. If you want to allow that the relationship can be delayed or lagged, you can use cross-correlation. This is similar to autocorrelation, which is a cross-correlation of a function with itself, in that it will give you many coefficients, each corresponding to a value of lag.


2

Here, MSE = variance / sample size. Bias is implicitly included, and trying to separate it out wouldn't be meaningful. Note that random forests often outperform regression with this task. The goal of a regression tree is to generate a line that best fits the data. MSE is the average squared difference between the actual data values and where the data point ...


8

If X and Y are normally distributed, you can use a Pearson correlation. If they are not, you can use a Spearman rank correlation. Here is some R code. > a <- c(1,2,3,4,5,6,7) > b <- c(2,4,6,8,10,12,14) > c <- c(2,5,4,10,8,13,11) > d <- c(7,6,5,4,3,2,1) > e <- runif(7, min=1,max=14) > e [1] 6.938054 1.347591 1.561456 10....


1

See Uniqueness of the SVM Solution by Burges and Crisp for most of the answers. Regarding "accuracy of the solution" - a couple of notes: in the real world we always find an approximate solution, in other words from a purely numerical stand-point we're always within some $\epsilon$ of the training performance of the optimum. Note that in terms of ...


3

This one's a little tricky because you don't really need to calculate much at all: the result follows from the symmetries of the expit function and the Normal distribution. The "expit" function is $$\operatorname{expit}(x) = \frac{1}{1 + e^{-x}} = \frac{e^{x}}{e^x+1}= 1 - \frac{1}{1 + e^x} = 1 - \operatorname{expit}(-x),$$ demonstrating that for ...


2

To compute$$\int_1^5 \mathbb I_{t\le \tau}\,\text{d}\tau/4$$one need break the domain of integration $(1,5)$ into the part where the indicator is zero, which is when $\tau<t$, namely $$(1,5)\cap(-\infty,t)=\begin{cases}\varnothing &\text{when }t<1\\(1,\min\{5,t\}) &\text{when }t>1\end{cases}$$ and the part where the indicator is one, namely $...


0

A matrix $A$ is a covariance matrix if and only if it is a symmetric positive semi-definite matrix (see here). A symmetric matrix is positive definite if and only if all of its leading principal minors are strictly positive (see here). A symmetric matrix is positive semi-definite if and only if all of its principal minors are nonnegative (see here). I ...


1

The non-existence of conjugate priors outside exponential families is related to the Fisher-Darmois-Piman-Koopman lemma. Which states that, for parameterised families with fixed support (hence excluding the Uniform counterexamples), there cannot exist a sufficient statistic $S_n$ of fixed dimension whatever the sample size $n$ is. Here is a version of the ...


2

The other answer by Stephen Kolassa gives you an excellent analysis of the Lyapunov condition in this case. However, I think it is also fruitful to look at this problem using moment generating functions. In your problem you have independent values $X_i \sim \text{Laplace}(0, \sigma_i/\sqrt{2})$, so these random variables have scaled moment generating ...


4

TL;DR You cannot use either the Lyapunov or the Lindeberg CLT to say anything about the convergence in distribution of $\frac{1}{s_n}\sum_{i=1}^n X_i$ (where $s_n^2=\sum_{i=1}^n\sigma_i^2$) without additional conditions on the sequence of variances $(\sigma_i^2)$. Neither CLT would say anything about $\frac{1}{n}\sum_{i=1}^n X_i$. If the sequence of ...


0

While your question is not entirely clear about what you are trying to achieve (how do you wish to go from a Gaussian distribution to a distribution that is truncated at 0?)... ... I thought that it was interesting to show something about the limit of the ratio between the mean and standard deviation of a Gaussian distribution that is truncated at $x=0$. (...


2

The car:::ANOVA.lm function tests if the model's deviance (its residual sum of squares) is below a precision limit: input <- read.table(text = "treatment fraction data trt1 F45 -4.15E-05 trt1 F78 -7.24E-05 trt1 F45 -1.65E-05 trt1 F57 -2.22E-06 trt1 F78 -2.78E-05 trt1 F45 -5.13E-05 trt1 F57 -5.96E-05 trt1 F78 -4.09E-05 ...


3

Note that $$\left(\begin{matrix}X_0\\ X_1\\ X_2\\\end{matrix}\right)=\left(\begin{matrix}2\\1\\0\\ \end{matrix}\right)+\overbrace{\left(\begin{matrix}1 &1 &0 &0\\ 0 &1 &1 &0\\ 0 &0 &1 &1 \\\end{matrix}\right)}^{\mathbf T}\left(\begin{matrix}A\\B\\C\\D\\\end{matrix}\right)$$ which as a linear transform of a Normal vector is ...


2

Whilst it is certainly quite simple to generate from a truncated normal distribution, if it is unrealistic to have negative values, you should rethink whether this distribution is appropriate. In the present case the lower-bound for the truncation occurs very close to the mean, and so the resulting distribution does not look much like a normal distribution. ...


6

This sounds like you want to sample from truncated normal distribution. If you only want to truncate the tails of the distribution (regions with low probability), than the approach suggested by Dave is probably enough. In other cases it might however quickly get inefficient. Better approach was suggested by Christian P. Robert in Robert, C.P. (1995). ...


2

I could imagine something where you use some if/else logic to screen for unrealistic values. There would be some kind of recursion where you keep drawing random numbers u til you’ve gotten 1000 (or whatever) realistic values. Some pseudocode: i=0 while i < 1000: x = make your draw here # (np.random.normal or rnorm, for instance) if x is ...


3

In short The simplified case, with spherically symmetric $\boldsymbol{\eta}$ (that is i.i.d $\eta_j \sim \mathcal{N}(0,\sigma)$), can be related to a transformed non-central t-distribution. We have: $$ \sqrt{n-1} \frac{\rho}{\sqrt{1-\rho^2}} \sim T_{\nu = n-1, ncp = l/\sigma} $$ where $l$ is the length of the vector $\mathbf{X}$. Geometric view of problem, ...


3

Part 1 If $y=\alpha+x\beta+\epsilon$ and $E[\epsilon]=0$, then $E[y]=\alpha+E[x]\beta$, therefore $\alpha = E[y]-E[x]\beta$. If you assume that $y$ and $x$ have the same marginal distribution, then $E[y]=E[x]=\mu$, and $$\alpha=(1-\beta)\mu,\qquad y=(1-\beta)\mu+x\beta$$ i.e. $y$ is a weighted average of the population mean $\mu$ and the predictor. But if $\...


-1

I believe the origin is somehow related to the following concepts: eigenvector: a vector $ \mathbf{x} $ is called an eigenvector of a matrix $ \mathbf{A} $ if $ \mathbf{A}\mathbf{x} $ = $k\mathbf{x}$ , meaning $ \mathbf{A}\mathbf{x} $ has the same form as $ \mathbf{x} $ (just different by a scaling factor $k$ called eigenvalue of $ \mathbf{A} $), hope you ...


18

The Oxford English Dictionary defines "conjugate" as an adjective meaning "joined together, esp. in a pair, coupled; connected, related." It's not a huge stretch to imagine that a conjugate prior has a special and strong connection to its posterior. It's used in a similar sense in chemistry (conjugate acid/base; conjugate solution), ...


0

Here is an approximate answer. $\left(1-\frac{p}{r}\right)^{nr}$ By taking natural log $(\ln)$ on the above equation we get $(nr) \ln\left(1-\frac{p}{r}\right)$ $\gt (n) \ln\left(1-\frac{p}{r}\right)$ (since $r>1$) $\gt (n) \ln\left(1-p\right)$ (since $0 \le \frac{p}{r} \lt p $ ) The above equation is the $\ln$ of the other part of the equation $\left(1-p\...


0

If possible, suppose there exists a UMP test $\phi^*$ (say) of level $\alpha$ for testing $H_0:\theta=\theta_0$ vs $H_1:\theta\ne \theta_0$. Then $\phi^*$ will also be UMP level $\alpha$ for testing $H_0:\theta=\theta_0$ against $H_1':\theta>\theta_0$ as well as $H_1'':\theta<\theta_0$. But a UMP level $\alpha$ test for $(H_0,H_1')$ is $$ \phi_1(\...


0

There are two issues here, (1) Getting a confidence interval of the desired length and (2) getting a representative (unbiased) sample of the population. For (1) it is often enough to use a formula to find the $n$ that will result in a confidence of the length you want. For (2) the task is more difficult. If your list is comprehensive, then a simple random ...


2

As others noticed in the comments, it wouldn't make much sense to have normalized parameters for Dirichlet. Notice that for $\alpha = (1/3, 1/3, 1/3)$, $\alpha = (1, 1, 1)$, or $\alpha = (100, 100, 100)$, the results of $\alpha' = \alpha / \sum_i \alpha_i $ would be in each case the same, i.e. $\alpha' = (1/3, 1/3, 1/3)$. You can check the What exactly is ...


3

A Cox model with a covariate $X$ is defined as $$ \lambda(t \mid X) = \lambda_0(t) \exp \left( \beta X \right) $$ where $\lambda_0(t)$ is the baseline risk and $e^\beta$ is the hazard-ratio. A Cox model stratified upon a categorical variable $Y$ with $k$ modalities is a Cox model where a different baseline risk is used for each group: $$ \lambda_k(t \mid X) :...


1

They used integration by parts. If $h$ and $g$ are functions then since $(hg)' = h'g + hg'$, $$ \int h'g = [hg] - \int hg' $$ Here in the integral $$ \int_{0}^{t^*} t^2 f(t) dt $$ they used $h'(t)=f(t)$ (thus $h(t) = F(t)$) and $g(t)=t^2$ (and $g'(t) = 2t$) which gives, \begin{align*} \int_{0}^{t^*} t^2 f(t) dt &= \left[t^2 F(t) \right]_0^{t^*} - \int_0^{...


0

Suppose the estimated parameters are: $$\hat{\beta}=(X^TX)^{-1}X^Ty$$ therefore, $$\hat{y}=X\hat{\beta}=X(X^TX)^{-1}X^Ty$$ since $Var(AX)=AVar(X)A^T$, we can have: \begin{align} Var(\hat{y})&=Var(X(X^TX)^{-1}X^Ty)\\ &=X(X^TX)^{-1}X^TVar(y)(X(X^TX)^{-1}X^T)^T\\ &={\sigma}^2X(X^TX)^{-1}X^T(X(X^TX)^{-1}X^T)\\ &...


2

(Not really an answer, simply an elaboration on the comment. Apologies in advance. It is a very interesting question. Hopefully the comment will be complementary to the answer(s) when they come along.) It seems that, in order to make meaningful statistical statements, one needs densities/likelihood functions. Therefore a dominating measure necessarily shows ...


1

Yes, you did something wrong. Look closely at what values you assumed for $p_0$ and $p_1$ when you evaluated the sum.


Top 50 recent answers are included