New answers tagged

0

There is no reason that the sum of inverse probability weights should be equal to 1 but you can always normalize each weight by the total sum of weights to obtain a sum equal to 1


2

The slides are about decomposing the event $$\{X_{(k)}\le x\}$$ into manageable disjoint events. When $X_{(k)}\le x$ one and only one of the following events occurs all $X_i$'s are less than $x$, i.e., $X_{(n)}\le x$ $X_{(n)}> x$ and all others are less than $x$, i.e., $X_{(n-1)}\le x$ $\ldots$ $X_{(k+1)}\le x$ and all others are more than $x$, i.e., $X_{...


0

I believe my previous solution, the current accepted answer, is wrong. My mistake was to treat the events [koi > catfish] and [coy > karp] as independent when they are certainly not. I believe the solution can be found as follows: $$ \begin{aligned} (Y>\max\{X_1,...,X_n\})&=P(Y>X_1,...,Y>X_n)\\ &=\int_{-\infty}^{\infty} P(Y>X_1,...,...


1

One way would be using log likelihood, so the sum of log likelihoods of each unit, in this case obtained from a normal distribution. Computation in R > -sum(dnorm(c(12,11,8),10,3,log=T)) [1] 6.552652 > -sum(dnorm(c(12,11,8),15,3.5,log=T)) [1] 9.535513 The goal is to minimize this value so the first case with mean 10 and SD of 3 is a better fit for the ...


0

I found an answer, maybe it will be helpful for someone. It turns out the answer follows from basic properties of preimages. $$ X^{-1}[\sigma(\mathcal{C})] = X^{-1}[\mathcal{C\cup\{countable\ unions,\ intersecions\ and\ complements\ of\ elements\ of\ \mathcal{C}\}}]=X^{-1}[\mathcal{C}]\cup X^{-1}[\{countable\ unions,\ intersecions\ and\ complements\ of\ ...


0

Under $H_0: p=.3,$ the number $X$ of Successes in ten trials has $X \sim \mathsf{Binom}(n=10, p=.3).$ Then $P(X \ge 8) = 1 - P(X \le 7) = 0.0016.$ In R: 1 - pbinom(7, 10, .3) [1] 0.001590386 This is an exact computation. I'm not sure I'd want to use a normal approximation for $n$ as small as $10$ and $p$ so far from $1/2.$ But here's how I would do it (...


0

For a 2-hour period, the number of calls is $X \sim \mathsf{Pois}(\lambda = 20),$ and in both (a) and (b), you seek $P(X=15) = e^{-20}20^{15}/15! = 0.05165,$ which you can compute on a calculator or by using R statistical software as shown below: dpois(15, 20) [1] 0.05164885 exp(-20)*20^15/factorial(15) [1] 0.05164885 Answer (a) follows directly; answer (b) ...


0

If it seems reasonable to assume that prices are normally distributed you can use gaussian mixture modeling to identify the clusters in your data. Consider the following example of chip sales. Let's say that chips are sold in packs of 1, 5, or 20 with associated average costs of \$1, \$4, $10 respectively. You don't know this exactly and you want to separate ...


0

I can't speak to specific details about a package that does this, but you could simply run a logistic regression for each class. For each model you would code one class as positive and the rest as negative. In your example you would train 4 models.


0

If the only property of the initial dataset that needs to be preserved is the rank order, then a variety of transformations are possible. Here's the simplest one I can think of: Let $m$ be the mean specified by the user, and $x$ be the initial data ($n$ points). For $i=1,...,n$, define the new values as $$ x_i' = 2m(i-0.5)/n $$ Map the $i$-th smallest $x$ to ...


1

As far as I can tell, you're basically right. If we look at the code, we can see that the calibration process directly calls SVC's decision_function method. SVC's decision_function notes: If decision_function_shape=’ovo’, the function values are proportional to the distance of the samples $X$ to the separating hyperplane. If the exact distances are required,...


2

In your solution, you calculate the probability of getting tails twice as the square of the probability of getting tails on the first flip. This assumes that consecutive flips are independent. In fact, they are not, as the same coin is used throughout and so getting tails on the first throw means it is more likely to get tails on consecutive throws. This is ...


4

We have \begin{align*} f_X(x) &=e^{-x}\\ f_Y(y) &=e^{-y}\\ f(x,y) &=\underbrace{f_X(x)\cdot f_Y(y)}_{\text{independent}}=e^{-(x+y)}\\ P\big(Y>X^2\big) &=\int_0^\infty\int_{x^2}^\infty e^{-(x+y)}\,dy\,dx\\ &=\int_0^\infty e^{-x}\int_{x^2}^\infty e^{-y}\,dy\,dx\\ &=\int_0^\infty e^{-x}\,e^{-x^2}\,dx\\ &=\int_0^\infty \exp\left(-x-...


0

You can easily get the answer using computer algebra packages such as Mathematica (Wolframalpha should work as well, but haven't tried). Here is the Mathematica code: dist = ExponentialDistribution[1]; Probability[y > x^2, {x \[Distributed] dist, y \[Distributed] dist}] The answer is: $$\frac{1}{2} \sqrt[4]{e} \sqrt{\pi } \text{erfc}\left(\frac{1}{2}\...


1

TL;DR: 11 (possibly 10). Plus 2. I got this by simulation, and to be honest, I think a closed formula will be quite painful to derive. Here is my thinking. Note that if the first three rolls already satisfy the condition, then I will record this as stopping after step 1, so if you are interested in the total number and would count this as step 3, you need to ...


0

Per the comments above, this appears unsolvable as-is without knowledge about the sizes of the dice (or at least some prior distribution on it). However, your comment indicates that your actual problem is a different one, namely, how many trials of a binomial experiment with unknown $p$ you need to run to estimate $p$ with a prespecified precision. This is a ...


2

For the discrete case, you need to look at DTFT, not DFT. N-point DFT assumes that the underlying function is periodic, which is not the case for probability mass functions. You can then apply similar logic for inverse transform: $$\phi_{x}(t)= E [ e^{itx}] = \sum_{k} e^{itx_{k}} p(x_{k})\rightarrow p(x)=\frac{1}{2\pi}\int_0^{2\pi}e^{-ixt}\phi_x(t)dt$$ For ...


4

It's sometimes useful to recast a problem in terms that yield better search engine results. Here is an alternative formulation of your problem: We throw balls at random into $n=6$ urns, with equal probability. How many balls do we expect to throw until one urn contains $k$ balls? And there is actually a closed form solution to this question at Balls are ...


3

This is not a full answer, but it may be helpful. We can model your problem as an absorbing Markov Chain. The possible states are $n$-tuples of numbers between $0$ and $k$, $$\mathcal{S} := \{0,\dots,k\}^n, $$ each state marking how often each number between $1$ and $n$ has already come up. (Of course, $n=6$.) The transient states are those where all entries ...


4

Noting that, \begin{align*} P(A\cup B) = P(A) + P(B) - P(A\cap B), \end{align*} and that since $P(A\cup B)$ is a probability, \begin{align*} P(A\cup B) \leq 1. \end{align*} So, \begin{align*} P(A) + P(B) - P(A\cap B) &\leq 1\\ \Rightarrow P(A) + P(B) - 1 &\leq P(A\cap B). \hspace{1cm} \square \end{align*}


0

Here are traces of running averages of winnings during four 15,000-play gambling sprees. Nothing is absolutely for sure, but it would be a surprise if the gambler didn't come out ahead (with average winnings near $\$0.80$ shown by blue lines) after many plays of such a favorable game. R code for figure: set.seed(2020) N = 15000; n = 1:N pay=c(-1,0,3,5); ...


1

For the machine learning classifiers that I know of (i.e. logistic regression, neural networks, bayesian classifiers, etc.), I am only familiar with these giving simple 1 or 0 classifications of some input falling into a particular class. This is not true. Most machine learning algorithms make predictions in some kind of score, that can be used for making ...


2

Since the 'scores' are not equally spaced they probably aren't the bin midpoints, so we can hope they are the bin means The mean is the weighted mean of the score wmean <- sum(score*freq)/sum(freq) To get the variance, take the weighted variance sum( (score-wmean)^2*freq)/sum(freq) (then square root to get the standard deviation) If the scores were the ...


0

The only simple relationship is that the hypergeometric is less variable than the binomial (because it comes from sampling without replacement rather than with replacement). The mean is the same and the variance is smaller by a factor $(N-n)/(N-1)$ So, in your example, the hypergeometric gives you more chance of getting a answer near $n/4$, and less chance ...


2

It's important here that $P_1$ is a projection matrix. If $Y$ is Normal, the distribution of a quadratic form in a projection matrix is a non-central chisquared, given by $Y^TPY/\sigma^2\sim \chi^2_d(\lambda^2)$, where $d$ is the rank of the matrix and $\lambda^2=\mu^TP\mu/\sigma^2$ is the non-centrality parameter. The non-central chisquared has mean $1+\...


1

I think I disagree with @gunes answer: $X|Y=y$ can be notation used to denote the random variable $X$ conditional on $Y=y$, and although it may not necessarily exist, it does in certain scenarios and has accordingly been used as notation (see notation in the example of the wiki page for conditional continuous distributions). To answer your question, I will ...


1

X|Y=y is the random variable X when conditioned on the realization of Y=y. $X|Y=y$ is a notation used inside expressions such as probability, expected value, variance etc. It is not a random variable. My intuition very strongly agrees, whether Y is y or not should have nothing to do with what I draw from X when I condition on Y=y. However I am not able to ...


2

The H-volume gives the the volume of some n-box (or hyper-rectangle) from some measure. Volume being generalised here for higher dimensions. When the measure is the Lebesgue measure, then the H-volume is our usual notion of length, area and volume in Euclidian space: $V_{Lebesgue}([0,0.5]) = 0.5$ (length) $V_{Lebesgue}([0,0.5]\times[0,0.5]) = 0.25$ (area) $...


2

It is possible to show that elementwise convergence in probability implies $\text{plim}_{k \rightarrow \infty} (X_n^k) = (X_n)$ (i.e., convergence of the sequence). Thus, your conjecture effectively stipulates that the probability-limit of a sequence of strongly stationary sequences is also a strongly stationary sequence. Since convergence in probability ...


5

Let $Y$ represent the length of a fish from the population of interest, such as bass, and $X_i$ represent the length of fish from another population $i$, such as karp or catfish. You want to calculate the probability that the bass is longer than the longest non-bass fish. That is equivalent to the probability that the bass is longer than the carp, and the ...


0

Maybe I'm misunderstanding the question but I fail to see why that expectation doesn't just blow up to infinity. Intuitively it is essentially just counting the number of times you draw red, given you have an infinite number of draws. And the only way this kind of infinite sum converges is if it is a geometric sequence inside some radius of convergence. But ...


2

Say, you have $N$ total possibilities ($10^6$ in your case). Probability of guessing the correct number at $x$-th guess means $x-1$ wrong guesses followed by a correct guess, that is ($x>1$): $$p_x=\frac{N-1}{N}\frac{N-2}{N-1}...\frac{N-x+1}{N-x+2}\frac{1}{N-x+1}=\frac{1}{N}$$ Probability of guessing the correct number upto (and including) $x$-th guess is ...


2

For any set $T$, the reason $$\sum_{y\in T}(Pr[Z=y]-Pr[Y=y]) = \sum _{y \notin T}(Pr[Y=y]-Pr[Z=y])$$ is that both $\Pr[Z=y]$ and $\Pr(Y=y)$ add to 1 over the entire sample, so $Pr[Y=y]-Pr[Z=y]$ adds to zero over the entire sample. So $$\sum_{y\in T}(Pr[Z=y]-Pr[Y=y]) + \sum _{y \notin T}(Pr[Z=y]-Pr[Y=y])=0$$ giving $$\sum_{y\in T}(Pr[Z=y]-Pr[Y=y]) - \sum _{y \...


0

If you're reading DSML, then I think you can just use the result they proved in the text for squared-error loss: note that $\mathbb{1}[Y_i \neq \hat{Y}_i] = (Y_i - \hat{Y}_i)^2$ when $Y_i, \hat{Y}_i \in \{0,1\}$.


0

I haven't checked it much, but this seems to do the trick in your example, basically I sum the value [val] in position [ind] and subtract [val] / (len(probs) -1 ) elsewhere, then take elementwise max(x, 0) and normalize import numpy as np def f(probs, val, ind): probs[ind] += val mask = np.ones(len(probs), bool) mask[ind] = False probs[mask] -...


0

Work in progress: There is, of course, a formal relationship between $z(p)$ and $z(p/2)$ such as the one stated in the answer by Xi'an but note that, as also pointed out in ping's comment on that answer, Xi'an's answer is merely a restatement of the question asked. The question asked by the OP is of some interest to those interested in digital communications ...


2

There are many ways to think extensions of MAB that may model what you describe. A first level of generalisation would be to consider a Contextual MAB problem, where at the beginning of each round you observe a context $x_t$, you choose an action $a_t$ and observes a reward $r_t = r(x_t,a_t)$ that depends on both your context and action. This models usually ...


1

Your answer is correct. This is the basic idea underlying the z-test (which is correct for a sample size equal to 250 and known variance). For the central limit theorem, you have $\bar{x}|\mu,\sigma^2 \sim N(\mu, \sigma^2/N)$ for $N \rightarrow +\infty$ which means that (considering $N=250$ large enough) $$ z(\bar{x})=(\bar{x}-\mu)/(\sigma/\sqrt{N})\sim N(0,...


0

If you want to go Bayesian, a mixture of Gaussians can be modelled as follows e.g. 2 components, $z=\{1,2\}$: for $i=1,\ldots,N$ $$ y_i|\mu(z_i), \sigma(z_i) \sim N(\mu(z_i),\sigma^2(z_i))\\ z_i \sim \text{Cat}(2, \mathbf{\theta}) $$ which states that the mixture component $z_i$ of the sample $y_i$ follows a categorical distribution with probability $\theta=\...


4

I do not understand the truncation in the probability computation. If an observation $X_i$ is generated from the mixture distribution with density $$p\varphi(x;\mu_1,\sigma_1)+(1-p)\varphi(x;\mu_2,\sigma_2)\tag{1}$$the probability that it comes from the first component is given by $$\mathfrak{p}(x_i)=\dfrac{p\varphi(x_i;\mu_1,\sigma_1)}{p\varphi(x_i;\mu_1,\...


1

Weierstrass Approximation Theorem: Suppose $f$ is a continuous real-valued function defined on the real interval $[a,b]$. For every $\varepsilon > 0$ there exists a polynomial $p$ such that for all $x \in [a, b]$ we have $|f(x)−p(x)| < \varepsilon$ (or equivalently, the supremum norm $||f−p|| < \varepsilon$). The notes ask you to prove the result ...


0

This follows my comment (using the approach shown in the Youtube video). Once you have the joint you can calculate the conditional. Sorry for the typo. Of course, $g_2(X,Y)=X$, and not $Y$.


0

After adding the value to the probability at the given index, here's one idea for how to adjust the resulting vector (let's call it $v'$) to get a probability distribution that should meet the requirements. If the value added initially was nonnegative, then just divide $v'$ by the sum of its entries, and stop there. (I'm assuming here that the starting ...


1

Both independence and having a distribution are properties that can be possessed only by random variables. In your example $y_i, x_i,z_i$ is a random vector, where for each $i$ they jointly have identical distribution and are independent of other such triplets. What we mean by such definition is that we treat the observations as realizations of the random ...


0

Why does this expression hold? A <- 0.10 B <- 0.75 exp(-A) == exp(-(A * B)) * exp(-(A * (1 - B))) #[1] TRUE Because that expression is simply a re-expression of: log(X*Y) == log(X) + log(Y) Where: X = exp(-(A * B)) and Y = exp(-(A * (1 - B))) Take the log of both sides of this expression: exp(-A) == exp(-(A * B)) * exp(-(A * (1 - B))): round(log(exp(...


4

Suppose you are trying to predict the outcome of an election on Proposition A, which needs 60% Yes votes to pass. Let $\theta$ be the unknown proportion of the electorate in favor. Maybe you have a favorable view of the probability of success, so you choose the prior $\mathsf{Beta}(7,3),$ which implies $P(\theta > 0.6) = 0.77$ 1 - pbeta(.6, 7, 3) [1] 0....


1

You can compute posterior probabilities using linear discriminant analysis under a strong assumption of multivariate normality of the predictors, e.g., you can't have a binary variable as one of the predictors. Since multivariate normality implies that the polytomous logistic model also fits the data, but logistic regression does not require normality, I'd ...


4

Your 1st case You could make your expression $\mathbb{E}(X)=\frac{1}{2}2+\frac{1}{2}\frac{1}{2}=\frac{5}{4}$ more correctly like: $$\mathbb{E}(M_{n+1})=\frac{1}{2}2\mathbb{E}(M_{n})+\frac{1}{2}\frac{1}{2}\mathbb{E}(M_{n})=\frac{5}{4} \mathbb{E}(M_{n})$$ and as a result: $$\mathbb{E}(M_{n})= \left( \frac{5}{4} \right)^n$$ I believe that this is the correct ...


1

Let's consider the example when $N = 3$ and $n = 2$. In the case, we are in the 3-dimensional space and we are handling of constraint which is in a plane. As the plane is two dimensional, Dirac delta has two components which is represented by product: $$\delta_{\{y_1 = (As)_1\}} \cdot \delta_{\{y_2 = (As)_2\}}$$ where $(As)_1$ is the first component of ...


4

See also this question; the proof is sketched in the related comments by @cardinal. Without loss of generality we can assume that the interval is $[0, \,1]$. Consider the following Bernstein's polynomial $$ B_n(x) := \sum_{k= 0}^n f(k/n) { n \choose k} x^k (1 - x)^{n-k} $$ which will provide an approximation of $f(x)$: we can prove that $B_n(x)$ tends to $f(...


Top 50 recent answers are included