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

learn more… | top users | synonyms (1)

0
votes
0answers
12 views

What is diffusion map? [on hold]

I have trying to understand this diffusion map,I know it has something to with statistics and reducing no of variables in calculation, I was reading a article which uses this diffusion map to ...
0
votes
0answers
32 views

ImplicitRegion gives arbitrary boundaries

equation1 is the major unbounded region I would like to generate ...
0
votes
0answers
28 views

How do I make a RNG in a function run only when I call the function? [on hold]

In Mathematica, I've made the following function: ...
3
votes
2answers
265 views

How do I generate n random numbers with an extra condition [duplicate]

I need to generate n random numbers that would sum into a. And I can't find an elegant solution here: ...
2
votes
3answers
493 views

For loop in Length computation code

Here is a code I wrote that is supposed to give the length of list after some splitting and regrouping. But it is inefficient. Is there a way to rewrite in more professional and efficient way? I guess ...
5
votes
2answers
122 views

How to find an estimated root efficiently with binary stochastic estimation of the function?

I am trying to construct certain nice geometric patterns, and one particular feature I'm trying to optimize is the balance of black and white corresponding to point being inside, or outside a ...
0
votes
2answers
142 views

Random non-overlapping disks in a square

I've found a nice code snippet by @belisarius from this question, that I'll reproduce here for reference: ...
2
votes
1answer
64 views

How do I define a random variable involving Part?

I need to define a random variable that involves Part, but when I try, for example ...
12
votes
1answer
468 views

What function generates random numbers in a compiled function?

I am writing a simulation for 2D random walk. I wrote several version of code, and found that the speed is like this (fastest to slowest): C++, Mathematica compiled procedural code, Mathematica ...
0
votes
0answers
65 views

Retrieving forthcoming step size from NDSolve

I'm solving a system of ODEs with a random component, which changes at each calculation step and depends on the step size. So I'm trying to realize something like this: (1) size of the forthcoming ...
6
votes
1answer
88 views

Slow-down encountered for RandomChoice in large lists

I was wondering if anyone could help me to speed up this code snippet which creates simple (sparse) networks by preferential attachment. The algorithm adds a vertex and an edge each time interval. ...
2
votes
2answers
81 views

Better to use loop or function when populated list?

In the past I have pretty much stuck to expression building when using Mathematica, but recently I have been writing a procedure to populate an array, which I guess are called "lists" in Mathematica. ...
1
vote
3answers
99 views

Partitioning List Into Sublists of Length 2 With The Pairing Being Random

I've done a bit of Googling with hopes of finding an answer, but to no avail. I'm looking for a way that I can have Mathematica take the elements of a list, say ...
3
votes
1answer
265 views

Plotting random circles in a square

How can we draw 20 circles which have random radius in a specified range, with random positions. All centers must be in a square with side=10 (for example centimeter): every overlapping between any ...
0
votes
0answers
44 views
5
votes
1answer
54 views

RandomGraph with specific constraints

I need to generate random connected simple graphs (no loops) with the constraint that exactly two vertices must only have a single edge. I can create many connected graphs (but very few will have the ...
12
votes
1answer
193 views

Regime Change Stochastic Process

I would like to simulate an Ito process in which the drift and diffusion terms change after hitting a boundary for the first time. For example, a Geometric Brownian Motion X which has 0 drift and ...
5
votes
2answers
390 views

Simple Monte Carlo simulation

I want to find the Monte Carlo simulation of the integral $$\int_0^1 \sqrt{1-x^2}\mathrm dx$$ The Cesàro mean is $$I_n=\frac1n\sum_{k=1}^{n} f(U_k) $$ I want to plot the scatter plot ...
1
vote
2answers
72 views

Calculating Variance (without Variance expression)

I am learning Mathematica on the fly, one of my tasks is to find the variance of white noise. I followed the tutorial for finding white noise by using the code: ...
10
votes
2answers
529 views

Generating uniform random points over a binary image

So I recently read this excellent post about generating random points over arbitrary regions. I hope Wolfram eventually builds that functionality into Mathematica's Random functions. I want to do this ...
7
votes
2answers
272 views

What's wrong with NIntegrate with “MonteCarlo” Method?

Bug fixed in version 10.2.0 My code is: ...
4
votes
3answers
149 views

How do I draw random points from a region [duplicate]

as the title,this problem have confused me a whole day.If I have a region,how can I yield a random member in this region.The region such as ...
2
votes
2answers
74 views

How do I execute a block of code multiple times? [closed]

Rudimentary pseudoconceptial question: I have a specific block of code that uses random variables and generates a plot at the end based on random code. I want my code to run 10 different times to get ...
0
votes
0answers
41 views

Parametrizing a matrix given its trace and norm

I have a problem where I have to generate random matrices with the following properties: ($a$ is a given fixed number) $\mathrm{Tr}\, A=0$ $\mathrm{Tr}(A^\dagger A)=\|A\|_F^2=a$ I was wondering ...
0
votes
2answers
121 views

Generate a list with random values between a and b [closed]

I am trying to perform system identification.. To properly identify the system i have to give the system a "rich" signal which are able to "activate" all the modes of the plant. A rich signal would ...
2
votes
0answers
38 views

Custom graph distribution

I am working with random graphs a lot. It's quite easy to describe random graph using, adjacency matrix or just a list of edges. However I am thinking that I might benefit from describing random ...
0
votes
1answer
67 views

usage of random numbers in recursive loop

I am trying to evalute two functions using iterative process as below ...
21
votes
1answer
310 views

Generating animations of clouds with Mathematica

I'd like to generate some visually-pleasing animations of clouds, fog or smoke with Mathematica. My idea of "visually-pleasing" is along the lines of one of the images on the Wikipedia article for ...
1
vote
2answers
289 views

How to generate a random, relatively prime number to p?

I'm sorry if this is an obvious question, but I'm a newbie and googling didn't help me much. Is there a way in Mathematica to generate a number q coprime with ...
1
vote
3answers
76 views

Fill an array, symmetric with respect to its centre

I want to create an array that must be symmetric with respect to the centre of it, as in the following example: 0 1 2 3 4 3 2 1 but, instead of having such ...
0
votes
1answer
62 views

How do I apply a conditional append rule to plot randomly chosen points?

I'm working on an attempt at forming a sort of "Mandelbrot" set using Newton's method and randomly chosen points. Effectively I need to define a loop for Newton's method to determine whether my points ...
8
votes
3answers
397 views

Turning a set of random walk data 45 degrees

I have a set of data that is just a "random" (generated by me, not by computer) sequence of length 2000 of 1's and (-1)'s. I used it to plot a 1-D random walk where +1 is step up, (-1) is step down, ...
1
vote
1answer
171 views

Combining Mandelbrot and Monte Carlo

I'm trying to combine plotting a Mandelbrot set with Monte Carlo randomization to plot an equation using random points for complex number z, for the function $z^3-2z+2=0$. Below is the code I have ...
1
vote
1answer
117 views

Finding uniformly distributed random points on an ellipsoid

I am trying to generate a poincare map for a system whose reduced energy manifold looks like the following surface. (x/a)^2 +(y/b)^2 +(z/c)^2=1 I want to find a ...
6
votes
3answers
362 views

Simulate random data with correlation

I would like to simulate some random data e.g. between 0 and 1, but with a given correlation. In other words some data where the correlation between two datasets is e.g. a constant or within a give ...
4
votes
0answers
76 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 ...
0
votes
1answer
207 views

Random numbers in C++ and Mathematica gives wrong results? [closed]

I have the following strange phenomenon which puzzles me!: I have a piecewise constant probability density given as ...
2
votes
1answer
115 views

Failed to create a special random-disturbed initial condition for partial differential equation

I try to use BSplineFunction to creat a initial condition for NDSolve which has periodic boundary condition, that is realized by ...
0
votes
1answer
119 views

Generate a small random disturbance on a flat surface for NDSlove

I want to generate a small random perturbation on a flat surface defined on a square domain, e.g. 1 + 0.05 rand(x,y), which can be used as initial condition with periodic boundary conditions in ...
0
votes
2answers
43 views

Simulate from an AR(1) process where the parameters vary over time

I would like to simulate from an AR(1) process, where the $\rho$ parameter in the process of the form: $X_t = \rho X_{t-1} + \epsilon_t$ varies over time. The path of $\rho$ and $var(\epsilon_t)$ ...
0
votes
1answer
87 views

How to improve this function that selects parameters from arbitrary distribution using Recursion?

Below, I have defined a function using Which to select model parameters based upon various conditions. My questions are: Is there any danger in writing this function using Recursion? Is there a more ...
10
votes
5answers
414 views

How to randomly select subsets

I have a list of around 300 elements. I want to sample subsets of length 25 such that my samples are all distinct. My first inclination was to use something like ...
13
votes
3answers
1k views

Can Mathematica's random number generation be improved?

Performance on Random Number generation is intolerable. Whenever you need many deviates from the same distribution but with different parameters it takes forever. Here is a thread on Poisson ...
2
votes
1answer
59 views

Why is RandomVariate of special probability distribution doesn't working in all cases

I would like to generate a random variates in Mathematica 9 with this distribution: ...
0
votes
1answer
41 views

Fit process parameters to a transformed AR(1) process

I would like to fit the parameters of an exponented AR(1) process using Mathematica's EstimatedProcess, however, the function does not seem to evaluate to anything. First of all I create the ...
1
vote
0answers
87 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
1answer
93 views

Time inhomogeneous Markov Chain in Mathematica

I would like to create a discrete 2-state Markov process, where the switching probabilities in the transition matrix vary with time. I can currently do the following, which creates a process with ...
2
votes
3answers
334 views

Creating a fast random array generator

I want to create N x N array of random numbers. (N is an integer). The constraints are, each element should be between 0 to l(integer) ( here 0<= l <= N) and the sum of elements in each row ...
0
votes
0answers
68 views

Random generation of three-non-collinear and four-non-coplanar points in 3D space

Please, take a look to this code. How it can be improved so that the time execution becomes smaller? ...