# Tag Info

0

Let $U,V\sim U\left(0,\,1\right)$ be two iid standard uniform random variables. Sample $n$ times from $U$ and denote the sum by $s_{x} := \sum_{k=1}^{n} u_{k}$. Note that this sum $s_{1}$ has the Irwin–Hall distribution, which is defined to be the sum of iid standard uniform random variables. I understand your question in the following way: You are asking ...

0

Here is an approach to produce a good approximation. Brute force generate lots of distributions until we achieve the desired total: target = Total@RandomReal[1, {1000}] 511.315 set2 = NestWhile[ Append[ Rest@#, RandomReal[1]] &, RandomReal[1, {1000}], Abs[Total[#] - target] > .0001 &]; Total@set2 511.315 % - target ...

0

Someone can maybe implement the following idea: It is enough to be able to produce a list of $n$ random numbers in range $[0,1]$ with total sum $s$, where the random numbers are chosen in some uniform (fair) fashion. Note that picking a random vector in $C=[0,1]^n$ is the same as sampling a hypercube. We can intersect this hypercube with the plane ...

5

If you want two lists to have the same Total, then you need to scale one of them by the right amount. The trick is to pick which one to scale so that both of the lists are within $U(0,1)$ n=2000; lists = RandomReal[1, {n, 2}] // Transpose; lists = lists (Min[Total /@ lists]/Total@# & /@ lists); Now you verify that they are both from the right ...

2

I have version 10.0.2, so i can't test this, but i think it works! n = 5; sum = RandomVariate[UniformSumDistribution[n]]; RandomPoint[RegionIntersection[Simplex[DiagonalMatrix[ConstantArray[sum, n]]], Cuboid[ConstantArray[0, n], ConstantArray[1, n]]], 2]

2

(Moved from the comments since I guess this is an answer...) Because the limit is 0. Heuristically, if you zoom into the function near $x=0$, it is of course just a flat line $\delta(x)=0$, so by the definition of the limit (which doesn't depend the actual function value at $x=0$) it gives 0.

2

General The data has heteroscedastic variables. For heteroscedastic data Quantile regression can be very useful. The blog post "Estimation of conditional density distributions" has analysis description that might be the answer of: The $e_i$ are independent noise from a distribution that depends on $x$ as well as on global parameters of the data; ...

2

This is what I imagined: L = ToExpression@Import["http://pastebin.com/raw/QQ926Qkw"]; design = Transpose[SparseArray[With[{sz = Length /@ L}, With[{sz2 = Accumulate[sz]}, Join[PadRight[MapThread[ Join[ConstantArray[0, #], #2] &, {Prepend[Most[sz2], 0], ConstantArray[1, #] & /@ sz}]], ...

2

Explicitly telling Mathematica that b is real and positive seems to help. Assuming[b > 0, X = UniformDistribution[{-b, b}]; Z = TransformedDistribution[X^2, X \[Distributed] UniformDistribution[{-b, b}]]; PDF[Z, x] ] Assuming[b > 0, XZ = ProductDistribution[X, Z]; pdf = PDF[XZ, {x, z}] ] Block[{b = 1}, Plot3D[pdf, {x, -1, 1}, {z, -1, ...

2

Since the joint distribution function is singular (proportional to $\delta(y - x^2)$ or something like that), you'll have to be creative about plotting it. Here's an attempt that's kludgey as hell, but it does give something: b = 1; ListPointPlot3D[Table[{x, x^2, PDF[Z, x] PDF[X, x]}, {x, -2 b, 2 b, b/100}], RegionFunction -> Function[{x, y, z}, z ...

1

If you start with $b = 1$ (for instance), you get (Mathematica version 10.3): $\begin{cases} \text{Indeterminate} & x=0\lor x=1 \\ \frac{1}{2 \sqrt{x}} & 0<x<1 \end{cases}$ Which seems perfect. Plot3D[ 1/(4 Sqrt[x]), {x, -1, 1}, {y, -1, 1}]

Top 50 recent answers are included