Tag Info

Hot answers tagged

10

ClearAll[dist] dist [rho_] := CopulaDistribution[{"Binormal", rho}, {UniformDistribution[{0, 1}], UniformDistribution[{0, 1}]}]; data1 = RandomVariate[dist[-.9], 5000]; ListPlot[data1, Frame -> True, AspectRatio -> 1] data2 = RandomVariate[dist[.6], 5000]; ListPlot[data2, Frame -> True, AspectRatio -> 1]


6

a bit of an extended comment, Note there is no need for a delayed defintion of your pdf: pdf[r_] = Simplify[2 (Piecewise[{{0, r <= 0.59}, {1.36814, Inequality[0.59, Less, r, LessEqual, 0.7]}, {0, r > 0.7}}, Indeterminate] + Piecewise[{{0, r <= 0.7}, {1.99139, Inequality[0.7, Less, r, LessEqual, 0.85]}, {0, r > 0.85}}, ...


4

No need folding 1D graph to get a 2D Random walk in Mathematica. and the CCW easy in Mathematica. Here we go: Generate data set for the random sequence with 2000 steps. Alternatively, you may use your "own generated" data set. rdata = Accumulate[RandomChoice[{-1, 1}, {2000, 2}]] Now plot it with similar layout as your example ListLinePlot[rdata, ...


4

rw = Accumulate@RandomChoice[{-1, 1}, 400]; ListLinePlot[rw, AspectRatio -> 1] rw2 = Transpose[{rw[[ ;; 200]], rw[[201 ;; ]]}]; llp2 = ListLinePlot[rw2, AspectRatio -> 1] To rotate llp2: Show[MapAt[GeometricTransformation[#, RotationTransform[-45 Degree]] &, llp2, {1}], PlotRange -> All] Aside: Using InterpolationOrder->0 ...


4

ListLinePlot[Accumulate @ Prepend[RandomChoice[{{-1, 0}, {1, 0}, {0, -1}, {0, 1}}, 1000], {1, 1}], AspectRatio -> Automatic] Starting with some random data rd = RandomChoice[{1, -1}, 2000]; ListLinePlot[Accumulate@rd] Creating a random walk similar to the one shown in your question rw = Accumulate@Transpose[{rd[[;; 1000]], rd[[1001 ...


2

f[r_?NumberQ,n_Integer]:={First[#],#.{r,Sqrt[1-r^2]}}&/@RandomReal[NormalDistribution[0,1],{n,2}]; Produces n pairs of numbers with the correlation r.


1

Brute Force: While[! ( .9 < Correlation[ a = RandomReal[{0, 1}, 10], b = RandomReal[{0, 1}, 10 ]] < .91 ) ] Correlation[ a, b] 0.900731 {a, b} // MatrixForm I expect this breaks down in a hurry for larger sets.


1

Every function of the following form satisfies your boundary conditions: $C_{i,j}=\left(a_{i,j}\cos(2i\pi x)+b_{i,j}sin(2i\pi x\right)\left(c_{i,j}\cos(2j\pi y)+d_{i,j}sin(2j\pi y\right)$ Therefore $f=\sum_{i,j} C_{i,j}$ also satisfies, for any random coefficients $a$, $b$, $c$, $d$. Here's a possible implementation: component[i_, j_] := (a[i, j] Cos[2 i ...



Only top voted, non community-wiki answers of a minimum length are eligible