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

learn more… | top users | synonyms (1)

0
votes
0answers
5 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
30 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
75 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 ...
8
votes
5answers
385 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 ...
11
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
43 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
23 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 ...
0
votes
0answers
56 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
64 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
182 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
43 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? ...
1
vote
1answer
72 views
6
votes
2answers
96 views

Sum considers RandomInteger[] as a constant

Perhaps this is expected behavior, but I was kind of surprised by the following: ...
23
votes
3answers
2k views

Generating 250 random points crashes the kernel, but not 249

Consider the following function, which generates uniformly random points on the surface of the 2-sphere: ...
2
votes
4answers
408 views

Random real numbers that sum up to specific value

In here, it works with "Integer". What if I want 5 positive real numbers that sum to 1? RandomChoice[IntegerPartitions[100, {5}]]/100. That will work. But only ...
0
votes
2answers
46 views

Getting RandomChoice to work in Manipulate function

I'm a beginner mathematica programmer and I am tryin to create my first demonstration. This code should represent what happens if one changes the size of the reading frame, calculating the nucleotide ...
1
vote
2answers
254 views

Generate nonoverlapping random circles [duplicate]

I want to distribute n circles unformly in an area(e.g. free plannar space). The circles could touch each other but cannot overlap. ...
0
votes
0answers
67 views

How to randomly create disks with randomized radii under given specific cover ratio? [duplicate]

I want to create uniformly distributed disks(dots) in a specific rectangular area. Suppose: the disk radii should be uniformly between $a$ and $b$ ($0<a<b$); there is no interaction between ...
1
vote
1answer
76 views

RandomVariate form a Specific Distribution with Restrictions

There are a lot of questions about generating random numbers form both uni-variate and bi-variate distributions. Mathematica has a lot of built in distributions for that purpose. However, I could not ...
1
vote
0answers
46 views

Help with Multivariate ProbabilityDistribution

I wish to obtain numbers from ...
4
votes
1answer
190 views

Monte Carlo Volume Calculation and Speed Up

I am trying to do a Monte Carlo area calculation for an irregular area defined by: $$0 \le x \le 1, 10 \le y \le 13, y \ge 12 \cos(x), y \ge 10 + x^3$$ I used the code with modifications (so I can ...
9
votes
2answers
199 views

Sampling phase space uniformly for a given energy

For example, for the 1D harmonic oscillator, the energy is given by: $$ E = \frac{1}{2 m} p^2 + \frac{m \omega^2}{2} x^2 $$ where x is position and p is the momentum. I would like to sample phase ...
5
votes
2answers
159 views

TemporalData, RandomFunction, Loops: Extracting data from TemporalData sets?

I'm doing a finance project for my differential equations class to explore stochastic processes. I'm exploring IRA retirement funds. From the project write-up: Standing assumption: at time of ...
11
votes
4answers
556 views

Generating Random Real numbers with certain numbers not included

I'm writing a program that i need 1000 real number between -3 and 6. the code that I used for generating and saving them was l = RandomReal[{-3, 6}, 1000] But I ...
0
votes
0answers
60 views

What graph distributions are available in Mathematica?

Where can I find a list of all the graph distributions available in Mathematica?
2
votes
1answer
92 views

Is random number generation based on Farlie-Gumbel-Morgenstern copula wrong?

I am constructing a bivariate Farlie-Gumbel-Morgenstern distributions with Normal and exponential marginal as follows: ...
4
votes
2answers
84 views

Generate non-overlapping permutations

Let l be a list l = Flatten[Range[7] & /@ Range[12]]; (* 1,2,3,4,5,6,7,1,2,3,4,5,6,7,... *) The question is to ...
0
votes
2answers
60 views

A constraint to RandomReal for sum of numbers equal to arbitrary n

I want to generate some random numbers but respect a constraint. So I use RandomReal[{0,1},N,WorkingPrecision -> 2] I want to fix a constraint in order ...
24
votes
3answers
364 views

Assign a randomly generated list to variable

Bug introduced in 10.0.0 and fixed in 10.0.2 I don't know if this is a silly question, but it really baffles me. So please help me understand this behavior. ...
1
vote
1answer
72 views

How to figure out the seed I used to generate several random numbers given that I didn't used SeedRandom at first place?

After generating thousands of random numbers, I figured out that I didn't used SeedRandom to store the seed. Is there a way for me to know what seed was used to generate these numbers? Thanks in ...
1
vote
1answer
142 views

Generate random nxn matrix with all negative eigenvalues

I need to generate an nxn matrix with random entries, but I also need all of the eigenvalues to be negative (real or complex doesn't matter). I have: ...
0
votes
1answer
61 views

Why does RandomFunction return variable number of data points?

I am using the following code snippet to generate Compound Poisson process random numbers: ...
2
votes
3answers
301 views

Coloring random points in an annulus

I have found the following random generator to generate points in an annulus in stackoverflow on stackoverflow ...
2
votes
2answers
107 views

How to randomly partition a range [closed]

I need to create a partition of a list of integers from $1$ to $n$ into a number of partitions of different size, with the constraint that the total number of elements in the partition must equal $n$. ...
8
votes
3answers
300 views

Random Integer Sequences

I want to construct a random square matrix in the following manner: a) Three states [0 | 1 | 2] are repeated ...
1
vote
2answers
94 views

Verify positive definiteness using random numbers

I wish to verify whether T'T - IdentityMatrix[2] is always positive definite for a certain choice of elements of T'T. ...
2
votes
2answers
262 views

How can I get this sum? [closed]

I want to sum the following numbers. At present I am calculating my sum as follows. a = 10^20 + 10^30 + 10^40; In the above case, if I want to add 100 or more ...
2
votes
1answer
57 views

Parallelization and evaluation of random number generation

Suppose I have the following functions: ...
4
votes
1answer
258 views

Generating random symmetric matrix

Suppose first that I want to generate a matrix whose elements are i.i.d. with distribution dist. This is easy: ...
3
votes
2answers
101 views

Sublists of Random Permutations

What is an efficient way to create a list of (psudo)randomly chosen permutations? I'm trying to create a list like below: ...
0
votes
0answers
36 views

Is there a reliable way to compute the Hurst Dimension of a time series [duplicate]

The Mathematica function FindProcessParameter exists but may be unreliable: FindProcessParameters for Fractional Brownian Motion Returns Error Is there a simple algorithm that can be done in ...
1
vote
1answer
70 views

FindProcessParameters for Fractional Brownian Motion Returns Error

I have the following data: ...
3
votes
1answer
81 views

What ProcessEstimator Options can I use with FractionalBrownianMotionProcess

I can generate an fBm process: ...
6
votes
1answer
246 views

Computing the Hurst exponent or fractal dimension of fractional Brownian motion

The Hurst exponent is related to the fractal dimension by noticing that the fractal dimension $D$ is equal to $2-H$, where $d$ is the intrinsic dimension and $H$ is the Hurst exponent, for 1-D ...
0
votes
0answers
71 views

How to deal with matrices involved in system of SDEs?

This question is in continuation of the the previous posts Solving Stochastic differential equation and Fast Simulations with Compile. What I want to do is numerically solving the epidemic model which ...
14
votes
6answers
587 views

How to generate random points in a region?

The Mathematica 10 documentation was updated for FindInstance adding support for regions. In my use case I'm trying to sample points in a set of disks: ...
24
votes
5answers
2k views

2D random walk within a bounded area

I want to simulate a random walk on two dimension in a bounded area such as a square or circle. I am thinking of using If statement to define a boundary. Is there a ...
1
vote
3answers
132 views

Random reals according to conditions

I'd like to create a list of triplets $(x,y,z)$ which satisfy the following properties: $$0<x<1/2 \\ 0<y<1/2-x \\ -1<z<-2(x+y)$$ Basically I would like to uniformly generate random ...
15
votes
1answer
365 views

Speed up adding Poisson noise to an image

I'm simulating some images corrupted with Poisson noise, but I'm encountering a few problems with performance. According to the documentation on ImageEffect, one ...
0
votes
0answers
43 views

Random reals according to probability distribution [duplicate]

How do I generate a list a random real numbers that follow a probability distribution? If my pdf is $f(x)$, how do I "force" the random numbers to follow $f(x)$?