# Tag Info

1

Just to add a couple of more observations to Nasser's. Case 6 As Daniel Lichtblau hints at in a comment, if we use an exact 37/10 in place of the approximate 3.7, we get an exact result with a zero imaginary component: Integrate[PDF[NormalDistribution[14, 37/10], x], {x, 15, Infinity}] N@% (* 1/2 Erfc[(5 Sqrt[2])/37] 0.393476 *) Case 7 Such a small ...

5

With f[a_, {x_, y_}] := Piecewise[{{a x, x < y}, {x, x == y}, {1 - a + a x, x > y}}, 0] one simulation can be defined by sim[length_] := Module[{rv = RandomVariate[BetaDistribution[3, 1], length], y, yBar}, y[1] = First@rv; yBar[t_Integer] := yBar[t] = 1/t * Sum[y[i], {i, 1, t}]; y[t_Integer] := y[t] = f[0.5, {rv[[t]], yBar[t - 1]}]; ...

5

Below are a couple of ways to add to Silvia's two. First a couple of remarks. Using 1/10 instead of 0.1 in the specification of the region allows Mathematica to apply exact methods. This may help, but it can also add significantly to computation time sometimes. What is important is to realize that there is a difference and to become familiar with the ...

6

There are two ways come to my mind to go. 1. Truncate the upper limits: Since OP has an exponential decay term like what it reads, truncating the integral limits at 2000000 should give a reasonably precise result: NIntegrate[( E^(-(x - 1000000)^2/(2*200000^2)) *E^(-(y - 1000000)^2/(2*200000^2)) *E^(-(z ...

3

I may have misunderstood the aims, If so, I apologize. For the first question: f[n_] := GraphDistance[CompleteGraph[5, EdgeWeight -> #], 1, 2] & /@ RandomVariate[ExponentialDistribution[1], {n, 10}]; : This generates a sample of size n of graph distances between vertex 1 and 2. You can visualize: Histogram[f[10000]] Estimating ...

1

With the function f[a_, {x_, y_}] := Piecewise[{{a x, x < y}, {x, x == y}, {1 - a + a x, x > y}}, 0] you can define a new function, that will perform a single simulation sim[a_Real, n_Integer] := Module[{data = Partition[Riffle[#, Accumulate[#]/Range[n]], 2] &@ RandomVariate[BetaDistribution[3, 1], n]}, f[a, #] & /@ data ] where the ...

0

This is somewhere between a comment and an answer, but here's a histogram of your sum distribution: dMix[p_, m1_, m2_, s_] := MixtureDistribution[{p, 1 - p}, {LogNormalDistribution[m1, s], LogNormalDistribution[m2, s]}]; Histogram[ Plus @@ RandomVariate[dMix[0.75, 0.5, -1.5, 0.2], {2, 400000}]] Meanwhile, here is a histogram of one of a typical ...

0

I post this for illustrative purposes. For thie particular distribution, there are two issues (i) the complex number can be handled with Chop (ii) the very small variance relative to the ellipical region. In the following I use a standard binormal distribution and use NIntegrate on region: bn = MultinormalDistribution[{0, 0}, IdentityMatrix[2]]; reg3[a_, ...

1

dist = MixtureDistribution[{0.2, 1 - 0.2}, {LogNormalDistribution[-2, 0.3], LogNormalDistribution[1.1, 0.3]}]; SeedRandom[1]; dat2 = RandomVariate[dist, 100]; estDist = EstimatedDistribution[dat2, MixtureDistribution[{p, 1 - p}, {LogNormalDistribution[\[Mu]1, \[Sigma]], LogNormalDistribution[\[Mu]2, \[Sigma]]}]] ...

0

Just to illustrate some other ways: As Karsten 7 has noted: Probability[xl < x < xu && yl < y < yu, {x, y} \[Distributed] bvn] yields: 0.39307 You can also specify MultinormalDistribution (noting the second argument is covariance matrix): bvn = MultinormalDistribution[{-3.89764, 1.29137}, {{0.08369444426^2, 0}, {0, ...

3

Since the PDF can be computed in closed form you might have some luck with ProbabilityDistribution and some half-way reasonable starting values. Generate the data... mix[p_, m1_, m2_, s_] := MixtureDistribution[{p, 1 - p}, {NormalDistribution[m1, s], NormalDistribution[m2, s]}]; mixdatSum = Plus @@ RandomVariate[mix[0.75, 0.5, -1.5, 0.2], {2, 100}]; ...

1

Tweak Solution Since Seth has provided 2 answers, I thought I might also put up another answer. My motivation for separating this from my original answer is that ... my original answer is a self-contained mathematical solution in transformations of random variables, essentially striving to side-step Mathematica's use of Boole which was not working, ...

1

Symbolically: Clear[s,a,b,c,d]; s={a,b,c,d}; uni@@s==Total[Map[-(-1)^Length[#]int@@#&,Rest[Subsets[s]],1]]/.int[q_]->q; uni[a,b,c,d] == a + b + c + d - int[a, b] - int[a, c] - int[a, d] - int[b, c] - int[b, d]-int[c,d] + int[a, b, c] + int[a, b, d] + int[a, c, d] + int[b, c, d] - int[a, b, c, d] Now, fill in ...

0

I spent some additional time on this problem and believe I MAY have solved it in a pretty general way with Mathematica. But I'm not sure and I still think there's more help needed on the problem. I'm going to use wolfies' substitution of the conventional x and y for my earlier used f and k. Basically, what we are after is the expected value of x over a ...

2

This is a very nice problem. If I may dispense with the notation for random variables as $f$ and $k$, and refer to them instead as $X$ and $Y$ ... The Problem Let $X \sim Uniform(0,1)$ and $Y \sim Uniform(2,5)$ be independent random variables, with joint pdf $f(x,y) = \frac13$: f = 1/3; domain[f] = {{x, 0, 1}, {y, 2, 5}}; We seek a closed-form ...

2

I figured out a way to answer a related simpler question, which is Expectation[ f \[Conditioned] f + \[Alpha]*k > p], {f, k} \[Distributed] UniformDistribution[{{a, b}, {k1, k2}}] Mathematica has trouble with this computation, but if you realize that it is the centroid of a polygon, you can use a feature of Mathematica to get a (long) answer ...

4

Mathematica does not automatically calculate the quantile (or InverseCDF) for arbitrary distributions. You need to do it. xd = ExponentialDistribution[1]; (* use exact argument *) yd = ExponentialDistribution[5]; (* use exact argument *) td = TransformedDistribution[ x/(x + y), {x \[Distributed] xd, y \[Distributed] yd}]; quantile[q_] = z /. ...

Top 50 recent answers are included