New answers tagged

0

WeightedRandomSampler samples randomly from a given dataset. It effectively does the shuffling for you. On the flip side, you actually can't turn off shuffling when you use this sampler.


0

I can only speak to your third question. There may be a better way to do this but the simplest way to do this in python that I see is to split your dictionary into an array of keys and an array of values. import numpy as np MyDict = {'A':0.4, 'B':0.2, 'C':0.3, 'D':0.1} keys = np.asarray(list(MyDict.keys())) values = np.asarray(list(MyDict....


0

The joint density $$\pi(\boldsymbol{x})=\overbrace{\left(\frac{\alpha}{2}\right)^n}^{\substack{ \text{correct}\\ \text{constant}}}\exp\left(-\alpha\sum_{j=0}^{n}\vert x_{j+1}-x_{j}\vert\right)$$ assuming $\boldsymbol{x}=(x_1,\ldots,x_n)$ writes as $$\pi(\boldsymbol{x})=\frac{\alpha}{2}\exp\left(-\alpha\vert x_{1}-x_{0}\vert\right)\frac{\alpha}{2}\exp\left(-\...


2

You have various different standard deviations and standard errors there. Trying to unpick them, for given $p$: An individual trial has variance $p(1-p)$ and standard deviation $\sqrt{p(1-p)}$ The sum of $n$ independent trials has variance $np(1-p)$ and standard deviation $\sqrt{np(1-p)}$ The mean of $n$ independent trials has variance $\frac1n p(1-p)$ and ...


2

A coin may be fair or it may be biased so that $p = P(\mathtt{Heads}) = 2/3.$ [Notice that I've gotten rid of the possibly confusing twist of letting $p$ be the probability of Tails.] We want to test $H_0: p = 1/2$ against $H_1: p = 2/3.$ [This situation in which $H_0$ and $H_1$ each specify only one value is called 'simple vs. simple'.] Data for the test ...


0

Here are simulated data that may be somewhat similar to yours. There are six groups with three observations per group. set.seed(2020) # for reproducibility of data x1 = rnorm(3, 100, 2) x2 = rnorm(3, 100, 4) x3 = rnorm(3, 110, 2) x4 = rnorm(3, 110, 4) x5 = rnorm(3, 115, 2) x6 = rnorm(3, 115, 4) x = c(x1, x2, x3, x4, x5, x6) gp = as.factor(rep(1:6, ...


2

First in Gibbs Sampling, you update one parameter at the time is not correct. Gibbs sampling is using a decomposition of the distribution of interest into conditional distributions for blocks of components of the vector $X$ to be simulated. These blocks can be of any dimension. Provided all components of $X$ belong to at least one of the blocks, and that ...


0

I think in your case you would need to fit a multinomial distribution (generalisation of binomial distribution for more than 2 classes), whose parameter is a vector of probabilities $\pi= (\pi_1, ..., \pi_k)$ where $k$ is the number of different classes. An easy way to estimate these probabilities is to comupte the different proportions of calls in the ...


4

Let the distinct values be $$X = \{x_1, x_2, \ldots, x_n\}.$$ Let the sample size be $m\, (=3).$ The ordered samples of distinct values are the subset $$\Omega = \{(y_1, y_2, \ldots, y_m) \in X^m\mid y_1\lt y_2\lt \ldots \lt y_m\}.$$ The question seeks a probability distribution on $\Omega$ with probabilities $$p(i_1,i_2,\ldots, i_m) = \Pr((y_1,\ldots, ...


1

While using the harmonic mean of the simulation densities as an estimator of one is "the worst Monte Carlo method ever", I checked its convergence by coding the simulation from $u(x,\cdot)$ on my own and I did not spot any discrepancy: > mean(1/propz(simox())) [1] 0.9945046 > mean(1/propz(simox())) [1] 1.001786 Here is my R code for completion. wrap&...


1

Observe that \begin{align*} \log \psi(x) &= \log \sum_{k\in\mathbb Z}\phi(x+k) \\ &= \log \sum_k \exp\left[ \log \phi(x+k) \right] \\ &= m + \log \sum_k \exp\left[ \log \phi(x+k) - m \right] \end{align*} The goal will be to perform the sum in log-space, and then exponentiate at the very end to get $\psi(x)$. First, if we take $m := \max_k\{ \...


0

OK, the service area is likely many hundreds of thousands for the U of Washington and for certain patients covers a five state area. The detection rate for a tertiary/quaternary referral center reflects the patient selection process, same criteria for referring patients in distress might lead to same detection rate. However, more precisely one cannot make ...


2

The mathematical definition of an unbiased estimator is: $E[u(X_1, X_2,\dots,X_n)]=\theta$. In English, this formula means that the expected value of a statistic, generally given as $u(X_1, X_2], \dots, X_n)$, equals the parameter (of the population) value. While a parameter has a single (probably unknown) value, a statistic has a distribution of values (...


0

Maybe it's just as well to put the CLT and $n = 30$ aside and take a look at a few simulated examples. Then maybe you can decide what you mean by a 'representative' sample. Suppose you have 10,000 measurements distributed as $\mathsf{Gamma}(shape = 5, rate=1/10).$ Then, theoretically, $\mu = 50, \sigma^2 = 500,$ and $\sigma \approx 22.36.$ In R, such the ...


1

A few thoughts (BTW, I'm analytical chemist, so I think very much along the lines that @EdV suggests), and I'd like to admit first that I've never had to worry about working with such coarse measurement tools. Anyways: Random and other errors my understanding is that uncertainty usually is assumed to be random No. At least in analytical chemistry, we ...


0

I'm speaking from the perspective of an analytical chemist/chemometrician here. As it is, the question is extremely general, and this means the answers will be very general and probably worst-case as well (since we don't have sufficient information about your study to tell you that in this particular case, things are easier, because...) So here goes: For ...


0

This can be discussed without getting technical using a simple example. Let's say we have an estimator to estimate the maximum value of a population. (This estimator is biased but consistent, but let's not even get into the technical discussion of bias vs. consistency.). Now, consider the following case: You have a population of {1, 2, 3, 4, 5, 6, 7, 8, ...


-1

A recent technique proposed for dealing with imbalanced distribution in regression is the Weighted Relevance-based Combination Strategy (WERCS). Branco et al. (2019) https://doi.org/10.1016/j.neucom.2018.11.100. The author has reproducible R implementation of the method at GitHub here: https://github.com/paobranco/Pre-...


1

The terminology may be the key here: The two $p$ you cite are in fact the same (if we regard the population as infinitely large). In this context, one trial is drawing one element from the population and recording whether it has the property of interest or not. So the probability of success $p$ (the probability of said element having said property) is the ...


0

in simple terms to say.... sampling distribution is the distribution obtained from the samples means or other statistics from the sample datas... where as the probability distribution is the distribution based on the parameters from the population.


0

Sure you could bootstrap this to get a handle on uncertainty -- after all, that's one of the reasons for bootstrapping in the first place. First, ensure that the entire "raw" dataset with $n=460$ cars are lined up in rows of an e.g. spreadsheet, database, etc. Assume there are 50 classes of cars based on your partitioning scheme, so make a 50 x 500 array ...


1

$x\sim D$ is not a typical notation if $D$ is a dataset. Normally the notation is used as $x\sim p(x)$ where $p(x)$ represents a probability distribution or the population. Abusing this notation, $x\sim D$ can mean $x$ is sampled from the dataset $D$, where every sample is iid, i.e. we get a random sample from the dataset. This dataset can be a usual dataset ...


2

Ok this question has been silent for a while, but I was intrigued and researched it. Here is what I came up with: The term in red on the third line arises as follows: We can calculate the expectation for a discrete random variable, $X$ using $$\text{E}(X) = \sum_{i=1}^k x_i p_i$$ where we have a finite number of outcomes, $x_1,x_2,\dots,x_k$ that occur ...


1

There are a few different approaches here. One possible approach would be to compute all possible pairs of measurements, limiting to those from different individuals: pairs <- t(combn(nrow(dat), 2)) pairs <- pairs[dat$Bat[pairs[,1]] != dat$Bat[pairs[,2]],] pairs # [,1] [,2] # [1,] 1 3 # [2,] 1 4 # [3,] 1 5 # [4,] 1 6 #...


Top 50 recent answers are included