We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [random]

Questions about random number generation and the properties of numbers so generated.

63 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
8
votes
0answers
117 views

RandomPoint works with a 2D ImplicitRegion but fails for any higher dimension

This is inspired by this answer which features code that I cannot get to work at all, and I tried to figure out why. It boils down to using the function RandomPoint...
8
votes
0answers
153 views

Restarting random number generators where you left off

I have code that uses both RandomReal and RandomInteger a number of times to produces a sequence of $n$ data sets. After ...
7
votes
0answers
69 views

Problem/bug with `RandomVariate` and `FirstPassageTimeDistribution`?

...
5
votes
0answers
82 views

Random number generation within Compile and Parallelization->True

According to this thread RandomChoice is a compilable function. I use it to generate random numbers in a compiled function with parallelization enabled. I wrote ...
5
votes
0answers
311 views

RandomVariate, MSE and Cramer-Rao bound calculation

I'm using the following code to plot the variance of a moment estimate of a parameter of Rice distribution and its' Cramer-Rao bound. First I generate $10^3$ vectors $\texttt{R}$ ($10^3$ elements in ...
4
votes
0answers
119 views

Generating random interlocking regions (i.e. countries)

I am trying to subdivide a finite portion of the plane into a set of at least 20 or so random interlocking shapes, with the shape boundaries having a fractal dimension around that of borders between ...
4
votes
0answers
259 views

Problem with the accuracy of the real-coded Genetic algorithm

Since there is no Genetic algorithm implemented in the Mathematica i tried to write a very simple genetic algorithm myself. The accuracy of the results depend upon rounding up the obtained parameters. ...
4
votes
0answers
116 views

List of mathematicians

How to make a list of mathematicians by using Mathematica? There are $284387$ person entity in Mathematica, but I need only mathematician entity I tried something like this ...
4
votes
0answers
98 views

Unexpected behavior of FindClusters

This is my code created by 10.4ï¼ ...
4
votes
0answers
34 views

Missing Completely at Random MCAR

Many other stats packages have tests for MCAR but Mathematica doesn't seem to. Have a I missed something? If not what would a simple implementation in MMA look like. (disclaimer I'm new to MCAR ...
4
votes
0answers
117 views

Converting problem into form involving Probability

I want to solve the following problem symbolically, using Probability: What is the probability of the first random variate of a set to be present more than once, ...
3
votes
0answers
86 views

Parallel evaluation of RandomVariate for an InterpolatingFunction

I need to generate a lot of point according to a given distribution. I don't have an analytic form of this distribution so I am using an InterpolatingFunction of ~100 points computed numerically. I ...
3
votes
0answers
62 views

Why does SeedRandom with same seed used twice produce such different results?

I have occasionally used RandomSeed[100] twice in the code and noticed behaviour that I don't understand. Consider: ...
3
votes
0answers
113 views

Generating random coordinates (3D) with constraint

I have been trying to generate random $(x,y,z)$ coordinates (i.e. for 15 ellipsoids) so that they obey following constraints: ellipsoid's length is constant, ellipsoids do not intersect (fulfilled ...
3
votes
0answers
95 views

RandomPoint not evaluating on RegionQ and ConstantRegionQ regions

When attempting to recreate and generalise the MatLab code for Random Vectors with Fixed Sum by first principles I came across a few issue with RandomPoint. ...
3
votes
0answers
50 views

RandomChoice inside RandomChoice

I have spent a half hour searching Mathematica.SE for information on this topic, with no luck. The code is: ...
3
votes
0answers
339 views

Generating a list of random numbers that follows a pattern

I'm a beginner to Mathematica. I'm writing a code to design a 4-bar linkage mechanism that traces a path in 2D space. I got the modelling done right, now I'm writing my own implementation of a genetic ...
3
votes
0answers
288 views

Solve ItoProcess SDE

I specified a SDE for a random process $y(t)$ using ItoProcess is there a mathematica function that provides the analytic solution for $y(t)$? I know ...
2
votes
0answers
66 views

Noise covariance matrix

I am trying to find the noise covariance matrix of a random vector $\mathbf{x}$ with itself. The elements of this vector represent image pixels and are treated as random variables i.e, $\mathbf{x}=\{...
2
votes
0answers
90 views

How to match random number generator to R?

Although I know the algorithm that R is using for pseudo-random numbers I am unable to match the generation of random numbers. ...
2
votes
0answers
64 views

How do decrease uncertainty of Monte-Carlo integration?

I have some function of many arguments and need to integrate it over the region given by the products of Heaviside theta functions. Namely, I write, say, ...
2
votes
0answers
732 views

Stochastic Gradient Descent with constraints

Let's say we have a convex objective function $f(\textbf{x})$, with $\textbf{x}\in R^n$ which we want to minimise under a set of constraints. The problem is that calculating $f$ exactly is not ...
2
votes
0answers
319 views

Random points on the Cuboid, and using FindShortestTour

How to plot a random points on the Cuboid? Graphics3D[{Yellow, Opacity[0.3], Cuboid[{0, 0, 0}, {1, 3, 1}]}, Boxed -> False] And how can I use ...
2
votes
0answers
157 views

How to use Compile? Bivariate Gibbs Sampler

I am trying to use compile to speed up my Gibbs sampler. I know I can use Reap and Sow to speed up tremendously. I have a more complicated Bayesian posterior that I want to speed up with compile so I ...
2
votes
0answers
193 views

Generates random number from custom multivariable probability distribution

I have the following input ...
2
votes
0answers
173 views

Mixture of a bivariate distribution defined as a copula

I define a bivariate distribution: ...
2
votes
0answers
99 views

Optimization of custom probability distibutions?

Consider the two tests: Timing[Do[RandomVariate[NormalDistribution[0.5, 0.3]], {200}]] {0.001188, Null} ...
2
votes
0answers
326 views

Von Neumann's method to generate points uniformly distributed on a region of a n-sphere surface

I am trying to generate points uniformly distributed on a region of a single n-sphere surface (all angles in hyperspheric coordinates are between 0 and Pi/2). I decided to use von Neumann's method ...
2
votes
0answers
970 views

Calculate variance of random walk?

How can I symbolically calculate the variance of the following random walk in Mathematica? Given several discrete random variables such that $p(Z_i=1-2k)=p$, where $k$ is a small real number, and $p(...
1
vote
0answers
24 views

What does this statement about congruential randomness mean in the documentation?

Reading through the random number generator guide on wolfram, under the methods section for the congruential method, it talks about the “Bits” option. Could someone explain what this means to me? I ...
1
vote
0answers
109 views

RandomVariate with ProbabilityDistribution performs well in 10.0, but not in later versions

I have a custom probability distribution function and I want to generate numbers according to this PDF. Interestingly enough, this works without trouble on my MacBook with Mathematica 10.0, but when I ...
1
vote
0answers
36 views

How to ask FindClusters to return the loss function value in the output?

I have some data points pts as below:- pts = BlockRandom[SeedRandom[123]; RandomReal[1, {100, 2}]]; Now I want to separate ...
1
vote
0answers
95 views

Bizarre error messages when monitoring random integers

I am doing tbl = {}; Monitor[ Do[AppendTo[tbl, RandomInteger[{1, 100000}, 2]], 100000], Length[tbl] ] (well in fact I am doing something less boring but what I ...
1
vote
0answers
52 views

Looking for a way to run through every time step of a cellular automaton function with random seeds

I have been creating 2D cellular automaton functions in Mathematica and I would like the output to be a graphical representation of the array at each time step. I know I can do this with ListAnimate: ...
1
vote
0answers
44 views

RandomVariate without zero

I want to get 10 random numbers drawn from a Poisson distribution with mean 1. But I do not want to include 0 in this. When I do ...
1
vote
0answers
74 views

Dealing with Vector Outputs from ItoProcess, RandomProcess (Stochastic Differential Equations)

I'm modeling stochastic chemical kinetics and the ItoProcess[] function has served me well. I am trying to write an efficient code to analyze many (Paths) trajectories of several different reagents (...
1
vote
0answers
79 views

Issue with RandomFunction and TimeSeriesModelFit in V11.2

I have a notebook which was working with V11 and now not working with V11.2. I have wind speed data with a regular timestep of 1hr. Taking a month : ...
1
vote
0answers
139 views

Parallelization of Monte Carlo numerical integration

I'm trying to parallelize some integral. What I do: I define integrand: ...
1
vote
0answers
93 views

Mathematica cannot generate the random variables for a given Probability Distribution

I need to generate a large number of random variables from the distribution generated by the following code. Distribution is given by DistributionF. The code is ...
1
vote
0answers
84 views

ItoProcess with log

I would like to use ItoProcess to simulate some paths of $r(t)$, a process that follows the sde $$d\ln\left(r\left(t\right)\right)=\left(\theta-\ln\left(r(t)\right)\...
1
vote
0answers
57 views

Alternative Methods of Using Cumulative Density Functions To Obtain Probabilities

I have a CDF that is generated from the subtraction of two arrays as part of a minimization procedure. A consequence is that events in the simulation can cause the subtracted total to be less than 0: ...
1
vote
0answers
240 views

How to use Halton sequence in Quasi Monte-Carlo integtation

I am trying to use Halton sequence numbers for MC estimator for rendering equation. At the moment I pass one instance of .Net Random object and get next number every time using same object thought the ...
1
vote
0answers
200 views

What is the symbol FE`None for?

I have run into the symbol FE`None multiple times. What is this symbol, and what is it designed to indicate? All I could find is that FE indicates the front-end, but it's unfortunately a very ...
1
vote
0answers
118 views

Generating random Kraus operators

I am trying to generate (randomly) set of square matrices $\{K_m\}$ with the properties that $$\sum_{i=1}K_i^{\dagger}.K_i=I_n,$$ where $I_n$ is the identity matrix of order $n$. So, the input should ...
1
vote
0answers
114 views

How do I keep a random value associated with a locator point as points are added?

I have a Manipulate to which I am adding and removing Locator points (one of which is different from the others, though that is ...
0
votes
0answers
39 views

One Function of Two Random Variable

I wonder how to implement below derivation in wolfram mathematica. I want to see integrate results like below picture. Can you help. I used "TransformedDistribution" but it shows only distribution ...
0
votes
0answers
23 views

Optimizing and Parallel Computing for Large Dyadic Intervals

I need help with the efficiency of my code i.e. less time so I can compute for large range of values. My function n[x] takes in a number x and outputs the ...
0
votes
0answers
29 views

Computing the same stochastic ODE many times but with different random seeds

I have this stochastic ODE, where I'm using ParametricNDSolve and WhenEvents : ...
0
votes
0answers
58 views

Random points from an image using a BernoulliDistribution

I am a Mathematica newbie. I need to sample random points from an image which I have stored in a variable img as: ...
0
votes
0answers
91 views

Allow or force self-loops in a Random Graph with 'BarabasiAlbertGraphDistribution'?

While generating random graphs, I assumed that self loops were allowed in the BarabasiAlbertGraphDistribution, but after checking the adjacency matrix, and the plot ...