# Tag Info

## New answers tagged distributions

1

It’s correct except the second because it’s either $Y_1=b, Y_2=c$ or $Y_1=c, Y_2=b$. That makes $2a(1-a)$. Your intution is correct, you’ll write the cases that lead to a specific outcome and accumulate the probabilities. Here, $$P(Y_1=b, Y_2=c)=P(Y_1=b)P(Y_2=c)=a(1-a)$$ A quick check: If you sum all three probabilies, it makes 1.

0

In the future please be more careful when asking your question. The screenshot of the problem is missing so much context; how do you expect others to know how $N_t$ and $S_{N_t}$ are defined? Furthermore there are careless typos throughout your professor's solution (writing $T$ sometimes instead of $t$, missing equals signs, misplaced parentheses, ...

2

As suggested by the comment of @whuber, since the package documentation does not tell precisely what is plotted, the answer is to be found in the code of the plot method for the S3 class "gpd" which is the class of fitmodel object in the code chunk. The answer is on the line #270 of the R code. The shown points are $[i, \, e_i]$ with $$e_i := \... 3 Since the wrapped Cauchy distribution is made of the superposition of truncated scaled Cauchy distributions^1 translated by 2n\pi:$$f_{WC}(\theta;\gamma)=\sum_{n=-\infty}^\infty \frac{\gamma}{\pi(\gamma^2+(\theta+2\pi n)^2)}\qquad -\pi<\theta<\pi$$it can be simulated by Simulating a regular Cauchy variate X with scale^2 \gamma Translating ... 1 Try covariate balancing, i.e. learn weights w_i, u_j such that \sum_{i} w_i X_i = \sum_j u_j Y_j and \sum_{i} w_i X_i^2 = \sum_j u_j Y_j^2 for two of the datasets \{X_i\} and \{Y_j\}, then sample using propabilities proportional to the weight. This should balance the mean and the variance at least. -1 If you have a good fitting regression model, a few 'negative passenger' results are not a problem, in my opinion, as one always just cap a large fall (or increase) prediction. In fact, if your explanatory variables are actually explaining passenger ridership levels, this is, from a modelling perspective, a possible positive as it may correctly delineate (at ... -1 Yes, Poisson regression only deals with Poisson variates, i.e, whole integers in the range [0,1,2,\ldots,+\infty]. Expected values from PREG will also be zero or positive. For linreg, you could log the outcome first, like y_i = \log(1 + y_i), where padding with one prevents taking the log of zero - which is undefined. Then transform the predicted ... 3 The issue is that you're not specifying the binwidth when constructing your histrogram even though the discrete nature of your data makes that critical. Try: ggplot(data = ice_cream) + geom_histogram(aes(x = ice_cream, y=..density..), binwidth=1, colour="black", fill="white") Note that we ... 2 A couple ways to do this: a) Plot the probability column using the probability column and geom_col library(tidyverse) ice_cream = 1:6 no_cust = c(225, 170, 55, 20, 20, 10) d = tibble(ice_cream, no_cust) d %>% mutate(y = no_cust/sum(no_cust)) %>% ggplot(aes(ice_cream, y))+ geom_col() b) uncount the ice creams library(tidyverse) ice_cream = 1:6 ... 2 You are correct: for a transformation T we have$$ P(T(X) = a) = P(X \in T^{-1}(\{a\})) = \sum_{x \in T^{-1}(a)} f_X(x). $$If T is invertible then$$ P(T(X)=a) = f_X(T^{-1}(a)) = (f_X\circ T^{-1})(a) $$so we are indeed just plugging T^{-1}(a) into the density of X. As to why the continuous and discrete cases are different, in one sentence I'd say ... 1 This is a standard matching problem equivalent to the problem of selecting a comparable comparison group from a pool of potential controls when assessing the effect of a treatment in an observational study. The goal of matching is to select a subset of the control pool to resemble the treated units. Instead of sampling, you should use matching. 1:1 optimal ... 1 Comment continued. My goal here is not to solve your problem explicitly; I don't have your actual data. However, I do want to show that there is no difficulty doing a test to compare two samples of vastly different sizes and getting reasonable results. I use fictitious data simulated in R. Data and summary: I have a large sample x1 of size n_1 = 9000 and ... 1 Part 1: Distinction between paired and 2-sample data. For a graphical display of measurements Before and After treatment for one group of people, it is often best to plot differences. If you show Before and After scores in separate histograms, stripcharts, boxplots, or other graphic displays the paired observations are not evident. If every one of 200 ... 4 One way to generalize the exponential distribution with density \lambda^{-1}e^{-x/\lambda} is to replace the argument in the exponential with -(x/\lambda)^k. That leads to the Weibull distribution with density function$$ \frac{k}\lambda \left( \frac{x}{\lambda} \right)^{k-1} e^{-(x/\lambda)^k},\quad x>0,\lambda>0,k>0 $$The second derivative ... 3 The exponential distribution with parameter \lambda is a special case of the gamma distribution with shape parameter 1 and scale \frac{1}{\lambda}. If you use a shape that is slightly larger than 1, you get something close to your picture: The second derivative of the log density is always negative, as required. The difference is the small "... 0 Since too much subjectivity is involved in checking normality of residuals, and since a large sample size may be required to reliably select a distribution, it's best just to plan on using the generalization of the Kruskal-Wallis test: the proportional odds ordinal logistic model. See Chapter 7 of BBR. Semiparametric regression models such as the ... 0 Here's what I ended up doing. My original question may have been a little ambiguous, but this solution gave me what I needed. Rather than using the probabilities that Player A would beat Player B and so on, I assumed each player would have a "score" S_i sampled from some distribution D_i. So S_A \sim D_A, S_B \sim D_B, and S_C \sim D_C, ... 0 Agree with the top answer that cross-entropy, as a distribution dissimilarity measure, may be more narrowly applicable to situations when we are comparing an estimated probability distribution (q) against the true probability distribution (p). If we only consider the true probability distribution p, its entropy is the expected value of the corresponding log-... 1 Goal: show P(Y_n \le t) \to P(X \le t) [for t at which F_X(t):=P(X \le t) is continuous]. Hints: P(Y_n \le t) = P(Y_n \le t, |X_n - Y_n| > \epsilon) + P(Y_n \le t, |X_n - Y_n| \le \epsilon). P(Y_n \le t, |X_n - Y_n| > \epsilon) \le P(|X_n - Y_n| > \epsilon). What does the right-hand side converge to? P(Y_n \le t, |X_n - Y_n| \le \epsilon)... 2 Here, I'm going to reproduce example 3.1.1 in Su (2009) where he calculates 95% confidence intervals for the 99th quantile for the speed of light data from Michelson 1879. It basically boils down to implementing the formulas (4), (5) and (6) from Su (2009). In the following R code, I used the gld package to fit the generalized lambda distribution (FMKL). The ... 3 While the continuous Bernoulli is defined as$$p(x)=C(\lambda)\lambda^x(1-\lambda)^{1-x}\qquad x\in(0,1)\tag{1}$$on its Wikipedia page, rewriting it as$$p()\propto \lambda^x(1-\lambda)^{-x} = \{\lambda/(1-\lambda)\}^x=\exp\{\eta x\}$$shows that it can be reparameterised as an exponential family with natural parameter$$\eta=\log\{\lambda/(1-\lambda)\}.$$The ... 0 I read that if X_1, X_2 are 2 random variables with different excess kurtosis, their joint distribution cant be elliptical. Is there an intuition or proof of that? It is not very clear to me. In my opinion the best intuition is the follow. Elliptical distributions deal with some stylized facts in finance returns, like: fat tails and tail dependence. ... 2 You're right: this is not (quite) a one-liner. But I can do a thorough job in just two lines by building on what you already know. Let's make some standard preliminary observations to simplify the work and establish the notation. Your t_\nu is a location-scale family based on the Student t distribution with \nu degrees of freedom with a location ... 6 No x can come out of the integral:$$\begin{align}\mathbb E[X]&=\int_0^\infty \underbrace{x}_u \underbrace{\lambda e^{-\lambda x}dx}_{dv}\rightarrow du=dx, v=-e^{-\lambda x}\\&=\left[xe^{-\lambda x}\right]_0^\infty-\int_0^\infty (-e^{-\lambda x})dx\\&=0 -\left[\frac{e^{-\lambda x}}{\lambda}\right]_0^\infty\\&=\frac{1}{\lambda}\end{align}... 1 You may be able to tell from the dimension of the second parameter whether it is a scale or a rate. 0 You have the distribution of cycles per day, and want the distribution of cycles in 20 years. Then you ask So what I am wondering is, can I simply multiply the number of cycles shown in the daily distribution by number of days in twenty years (7305)? That would be correct only if each of the components have a constant daily number of cycles, each day for ... 1 Partially answered in comments: There might be some conventions, but they would vary between fields ... otherwise: if they never write it down explicitly, then I you have to infer it from context. But if they have a special case where they say: "In the case of the gamma parameters being such and such, we obtain an exponentially distributed rv with ... 2 Infinitely many answers are possible, some links in comments. One family is the skew-normal, but it only admits limited degrees of skewness. The same ideas used to construct the skew-normal family from the normal family can be used for other families! For empirical modeling with skewness have a look at the gamlss system, which admits many families. 1 Time-to-ruin in the discrete-time random walk: From your question, I take it that you are referring to a discrete-time version of the gambler's ruin problem. Without loss of generality we can consider the wealth of the gambler denominated in units equivalent to the betting amount. We will assume that the wealth of the gambler is a positive whole number of ... 2 I'll give a fairly simple example, but this should give you an idea for how the idea is useful in other scenarios. Suppose you fit a linear regression to some data which is strictly positive. I.e. Y > 0 (e.g. Y=\text{house prices in your area} x=\text{square footage of house}). Fitting a linear regression might give us predictions which are ... 0 Which predictors do you use? From what I understand of Biomod2 projections (see below), this mask is based on the future values of your explanatory variables, not on their current values. Therefore it makes sense that this mask can overlap with your study zone. For instance, if the current average temperature of your study zone is between 10°C and 13°C, and ... 2 The antiderivative of a Gaussian function has no closed form, but the integral over \mathbb{R} can be solved for in closed form: \begin{align} \int_{-\infty}^{\infty} \exp(-x^2) dx = \sqrt{\pi} . \end{align} Since \exp(-x^2) is an even function (graph is symmetric about the y-axis), we can split this into two equal parts \int_{0}^{\infty} \exp(-x^2) ...

0

With tree regression, you can be a little more relaxed about assumptions. In particular, you simply give up on the "linearity" (or more precisely, the correct functional specification) assumption, because the natural process obviously does not follow the piecewise flat segmentation that is assumed by the tree model. Instead, you simply acknowledge ...

0

I found out that the answer is negative binomial as @TMat suggested. I needed to rearrange the terms.

1

The formulas you have given can be used to construct moment estimators. But you can also use maximum likelihood estimation in the marginal negative binomial distribution. The variance of the gamma distribution is a function of the negbin parameters, so just use the same function on the maximum likelihood estimates of $r,p$ to get the maximum likelihood ...

0

You do not define hand size $n,$ the number revealed $r,$ the meaning of 'good', 'bad', 'neutral' (for the actual cards) or how specific the claims are to be. So only made-up examples seem possible. Here are a couple of examples. (1) $n = 13;$ All cards are good, claimed "Mostly not good" (we assume 6 'good' and 7 not). We might doubt the claim ...

0

Let's stay on topic with Bayesian statistics. Call the binomial success parameter $\theta.$ If you put a prior probability distribution on $\theta,$ it might be $\mathsf{Beta}(2,3)$ and the relevant beta density might be written as $$p(\theta) = \frac{\Gamma(2+3)}{\Gamma(2)\Gamma(3)}\theta^{2-1}(1-\theta)^{3-1} = 12\theta^{2-1}(1-\theta)^{3-1}.$$ for $0<\... 1 Note that this expectation does not exist for all$g$, because if$g$is sufficiently fast-growing then$E[g(\bar X_n)]$may not be finite for any$n$. For example, this happens if each$X_i$follows a standard normal distribution, so that$\bar X_n \sim N(0, \frac 1 {\sqrt{n}})$, and$g(x) = e^{x^8}$. (Though the specific$g$that you are most interested in ... 2 Let us begin with the example$g(x)=|x| 1_{|x|>c}$. Suppose that$X_1,\dots, X_n$are centered and have finite second moment$\sigma^2$. Denote$F_n(x)=\mathbb{P}\left(\frac{1}{\sigma\sqrt{n}}\overline{X}_n\le x\right)$. We work with$\frac{1}{\sigma \sqrt{n}}\overline{X}_n$instead of$\overline{X}_n$as it simplifies the computations, please change$c$... 0 What McConnell proposes is simply a different point on the exact same distribution. The further you move your choice to the right of the distribution the more certainty you choose. But you do not change the underlying distribution. That should not be confused with the modified Pert suggested by Vose (2000) which leads to a different means and variances (see ... 5 Bhattacharyya distance and KL divergence both measure the dissimilarity between two probability distributions, but they do it in different ways. This means their numerical values are not directly comparable and, furthermore, they may not agree on the relative dissimilarities between multiple distributions. For example, suppose we have two distributions$q_1, ...

2

An example in which case we get this sum is when we consider the distribution of the squared Euclidian distance (from the origin) of a multivariate normal distributed variable $X$ with covariance $\Sigma$. Instead of considering the sum $\sum_{j=1}^p \lambda_j U_j$ we can also consider the sum of $\sum_{j=1}^p X_j^2$. Thus a sum of correlated variables. The ...

1

It rather depends on what tools you have available. There are also curiosities: if the minimum is $n$ then $n+1$ turns out not to work, so approximations may not be sufficiently precise. But here are some hints: What is the probability $p$ that a particular item will last more than a year? What is the probability $q$ that it will fail in the first year? ...

0

I cannot find the connected earlier questions on $\mathsf X$ validated but many addressed this issue of making a proposal $q(\cdot;\cdot)$ that covers more than the support of the target distribution $\pi(\cdot)$. This is not an issue: when $$x'\sim q(x;x_t)$$is such that$$\pi(x')=0$$the Metropolis-Hastings acceptance ratio $$1 \wedge \dfrac{q(x';x_t)\pi(x')}... 0 The random variables Z_i:=\mathbb{1}_{\{X_i\,\in\,B\}} for i\in\{1,\ldots,n\} are i.i.d \text{Bernoulli} with unknown parameter \theta=\mathbb{P}(X\in B). Using a \text{Uniform}(0,1) non-informative prior distribution for \theta the posterior distribution is \text{Beta}(1+nT_n(B),1+n(1-T_n(B))). Under a quadratic loss penalization, the bayesian ... 1 Using wikipedia's definition:$$\begin{align}\int\hat f_h(x) d&x=\frac{1}{nh}\sum_{i=1}^n \int K\left(\frac{x-x_i}{h}\right)dx\\&=\frac{1}{nh}\sum_{i=1}^n \int K(u)hdu\\&=\frac{1}{nh}\sum_{i=1}^n h\\&=\frac{nh}{nh}=1\end{align} So, it integrates to $1$. I think it's obvious that it's non-negative due to $K(.)\geq 0$.

0

I could not find any library so I created following Python code. I cross verified with scipy implementation for 2 distributions and get the same result source. # Calculates the JSD for multiple probability distributions def jsd(self, prob_dists): weight = 1/len(prob_dists) # Set weights to be uniform js_left = np.zeros(len(prob_dists[0]))...

0

the difference of two independent or correlated Gamma random variables are special cases of McKay distribution. The exact and complete answer can be find in: Sum and difference of two squared correlated Nakagami variates in connection with the McKay distribution Holm, H., Alouini, M.-S. IEEE Transactions on Communications, 2004 Vol. 52; Iss. 8

0

You want to know the probability that someone will be in the undergraduate state under specified conditions. You also seem to have data only for year-long time periods. So a simple approach would be to treat this as a logistic regression to predict the probability of that status at the end of each year-long time period. For each individual you set an ...

3

This is an application of the Law of total variance: https://en.wikipedia.org/wiki/Law_of_total_variance Let $P = Unif(0,1)$ and $Y = Binom(k,p)$ First let's note that: $E[P] = \frac{1}{2}$ $Var[P] = \frac{1}{12}$ $E[P^2] = Var[P] + E[P]^2 = \frac{1}{3}$ Then the law states that $Var(Y) = E[Var(Y|P)] + Var[E(Y|P)]$ $Var(Y|X=p) = kp(1-p)$ Because Y is ...

Top 50 recent answers are included