Skip to main content

All Questions

Filter by
Sorted by
Tagged with
2 votes
1 answer
100 views

How to use Mathematica to find the explicit formula of expected value of minimum of multiple uniform distributions?

...
138 Aspen's user avatar
  • 2,067
3 votes
1 answer
239 views

How to use Mathematica to find the maximum expected value of multiple normal distributions?

Is it possible to calculate the maximum expected value of $ n (n\geq 2) $ independent (identical distributed) random variables that follow a normal distribution? If possible, how to find it? If it ...
138 Aspen's user avatar
  • 2,067
5 votes
2 answers
693 views

How do you generate a random number with a pre-specified probability distribution?

I want to generate a random real number between 0 and 1 but not distributed uniformly but with a probability distribution say, 2 Sin[ pi x ]^2 which integrates to 1 ...
Quasar Supernova's user avatar
1 vote
0 answers
67 views

How to generate random points with weight distribution and specific criteria? [duplicate]

Consider some function $f(E_{1},E_{2})$, say $$ \tag 1 f(E_{1},E_{2}) = \exp[-E_{1}^{3}+E_{2}^{2}] $$ I want to generate random $n$ points $E_{1}$, $E_{2}$ using this function as weights, with an ...
John Taylor's user avatar
  • 5,963
2 votes
1 answer
61 views

Are there any issues/best practices/suggestions when working with a DataDistribution instead of a distribution?

Suppose there is a random variable $X$ that can take on values $-1,0,1$, with probabilities $P(X=1)=P(X=-1)=.25$ and $P(X=0)=.5$. How can I work with such a random variable in mathematica? (Find the ...
user106860's user avatar
3 votes
1 answer
194 views

How to generate random variate in custom domain for a distribution?

I have a distribution defined in a particular domain of the variable but now I want to generate a random variable not in the entire domain but only in a subset of the domain. Here is what I'm trying ...
user avatar
-1 votes
1 answer
105 views

Can the WishartMatrixDistribution command be used for generating random density matrices?

I am interested in generating random members of two classes of $n \times n$ positive-definite matrices $A$ and $B$--the former symmetric in nature, the latter, Hermitian. The standard (Ginibre-matrix-...
Paul B. Slater's user avatar
6 votes
1 answer
584 views

RandomVariate cannot sample from a custom multivariate ProbabilityDistribution

Let us try to define 2D distribution through PDF: ...
Konstantin's user avatar
2 votes
1 answer
103 views

Random Number Generation using LogNormalDistribution

I have a problem that I can't seem to figure out on my own due to limited knowledge of mathematics, and I was hoping I could seek help from the community. I would like to use ...
e.doroskevic's user avatar
  • 5,989
3 votes
1 answer
253 views

Generate a uniform distribution over an $n$-simplex employing quasi-random low-discrepancy points

This post is intended in a similar direction to an earlier one Can I use Compile to speed up InverseCDF? . I now wish to generate uniform points in an $n$-simplex (specifically $n=8$), making use of ...
Paul B. Slater's user avatar
21 votes
5 answers
1k views

Sisyphus Random Walk

A Sisyphus Random Walk evolves as follows: With probability (r) you advance the position of the walker by +1. With probability (1-r) the walker resets at x0 = 0. To simulate the probability of reset ...
smallscot's user avatar
  • 675
7 votes
5 answers
1k views

Survival Probability for Random Walks

The Survival Probability for a walker starting at the origin is defined as the probability that the walker stays positive through n steps. Thanks to the Sparre-Andersen Theorem I know this PDF is ...
smallscot's user avatar
  • 675
2 votes
1 answer
86 views

Drawing random numbers from TransformedDistribution

Suppose I have created the following TransformedDistribution: ...
user120911's user avatar
  • 2,705
4 votes
3 answers
876 views

Construct Distribution Histogram From Random Variable

Given a Beta Random Variable $X$ with parameters $\alpha, \beta$ and a positive constant $n$, suppose I am interested in the distribution of: $$Y:=\lfloor nX\rfloor$$ Suppose I want a histogram ...
EllipticalInitial's user avatar
3 votes
1 answer
267 views

Generating the cumulative distribution function (CDF) of a tuple made by RandomFunction

I use the RandomFunction to generate a continuous random function (trying to model a rough surface): ...
Foad's user avatar
  • 615
3 votes
2 answers
664 views

Distribution of Function of Random Sum of Random Variables

Let $ S = \sum_{i=1}^n X_i$ where: Each $X_i$ is independently 3 or 9 (with equal probability), and The sample size $n$ is itself an independent random variable where $N \sim \text{NegativeBinomial}(...
EllipticalInitial's user avatar
3 votes
1 answer
827 views

Simulate random sample from defined probability density function

Suppose I define a function in mathematica that has all of the properties of a valid probability density function. Would it be possible to have Mathematica simulate a random sample of a given size of ...
EllipticalInitial's user avatar
3 votes
3 answers
147 views

SkewNormalDistribution with a mean value

Since it got incredibly good answers the last time i posted a question, i try it again! ;-) I programmed a chemical/physical simulation in mathematica, where i can use residence time distribution as ...
blackbow's user avatar
1 vote
1 answer
246 views

Modeling Dependent Joint Distribution

I'm trying to model the joint pdf of (X,Y) from example 4.5.8 of the text Statistical Inference 2nd Edition, Casella, Berger (pg 199 of the pdf). Essentially, X ~ Uniform[0,1] Z ~ Unfiorm[0,1/10] Y ...
TensorFlow's user avatar
3 votes
1 answer
475 views

First passage time distribution in mathematica

I'm trying to calculate first passage time distribution for some processes in Mathematica. First I tried to calculate this for Wiener process with zero drift and $\sigma = 1$ and the absorbing ...
Msdos4's user avatar
  • 33
10 votes
4 answers
845 views

Uniform distribution on z = 1 − √( x ^2 + y ^2) , z ≥ 0 [duplicate]

Let $S$ belong to ${\rm I\!R^3}$, $z = 1 − \sqrt{x^2 + y^2}$ , $z ≥ 0$. I need to write a program that generates a random point on $S$ with uniform distribution. I've tried to use ...
Freddy's user avatar
  • 101
8 votes
1 answer
898 views

How to implement Monte Carlo Importance Sample in 2D or in N dimensions?

So far i have managed to implement the Crude Monte Carlo (CMC) and the Importance Sample Monte Carlo (ISMC) for unidimensional problems. Consider the function ...
Stratus's user avatar
  • 2,964
0 votes
1 answer
80 views

Evaluating expression involving a family of probability distributions

I'm trying to use Mathematica to solve a problem involving any continuous probability distribution $F(t)$ such that: $$\begin{align*} F(t)&=0, \; t\leq0\\ F(t)&=1, \; t\geq1 \end{align*}$$ ...
Houston Mooncat's user avatar
1 vote
1 answer
147 views

RandomVariate from Multiplying distributions

Mathematica's RandomVariate works fine with the KernelMixtureDistribution[] function, but it doesn't seem to work if you wish to ...
Dr. Ikjyot Singh Kohli's user avatar
3 votes
3 answers
888 views

Produce a probability vector with uniform distribution [duplicate]

A probability vector is a vector $\mathbf{p}=(p_1,p_2,\ldots,p_n)$ with the following properties: $\sum_{i=1}^{n}p_i=1$ $p_i\geq 0$ Assume that the set of all possible probability vectors is $\...
Math_Y's user avatar
  • 131
4 votes
3 answers
274 views

RandomVariate of ProbabilityDistribution returns values outside the support of a CDF (non-symmetric PDF)

From this post (95069) I can see that this question has been been given a workaround for symmetric PDFs and that the bug was eventually addressed. I checked and the fix is still in place for my ...
Edmund's user avatar
  • 43.2k
1 vote
0 answers
101 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 ...
George Harnandez's user avatar
3 votes
1 answer
92 views

RandomVariate problem with PascalDistribution? (10.3, Win) [duplicate]

Observe: ...
ciao's user avatar
  • 26k
7 votes
3 answers
3k views

How do I define a two point random variable?

How do I define a random variable $X$ such that $Pr[X=x_1]=p_1$ and $Pr[X=x_2]=p_2$ where the values $x_i$, $i=1,\,2$ are just symbols and the probabilities $p_i$, $i=1,\,2$ are symbolic expressions ...
Michal's user avatar
  • 145
7 votes
3 answers
1k views

Creating a custom distribution with specified skew and kurtosis

Let's say I want to create a simulated sample of returns for a given investing/trading strategy. I know that my strategy is profitable on 64% of trades, that the ratio of mean win / mean loss is 0.72, ...
pyrex's user avatar
  • 399
2 votes
1 answer
1k views

How to generate samples from an arbitrary continuous pdf?

If I define an arbitrary pdf p[x_] for a arbitrary-dimensional continuous variable x, how can I use Mathematica to create a function that will return a set of n random samples of x with distribution p?...
Jerry Guern's user avatar
  • 4,642
0 votes
1 answer
172 views

Draw independent samples from conditional distribution at a fast rate

I would like to draw samples from the following conditional distribution of the following (don't ask why): ...
ben18785's user avatar
  • 3,167
6 votes
2 answers
903 views

Speed up RandomVariate on a custom probability distribution

I have created a custom probability distribution: ...
ben18785's user avatar
  • 3,167
7 votes
4 answers
467 views

How to generate two group of $n$ random numbers in $U(0,1)$ such that sum of these two groups equal? [closed]

I want to have two groups of $n$ random numbers $u_i$ and $v_i$ in $U(0,1)$, such that $\sum u_i = \sum v_i$ What I tried is: I can firstly get $u_i$ by ...
LifeWorks's user avatar
  • 427
4 votes
1 answer
274 views

Random Variate generating strange results when using ProbabilityDistribution

Bug introduced in 10.1 and fixed in 10.3 I have created a probability distribution that follows a general normal distribution, given by: $$ \frac{b *e^{-\left(\frac{\sqrt{(x-u )^2}}{a }\right)^{b }}}...
Fábio's user avatar
  • 133
4 votes
2 answers
637 views

Generate a random PDF

How can I generate a random probability density function $p(x)$ in the domain $[0,1]$? Is there a single Mathematica function to do so?
Mathreader's user avatar
14 votes
3 answers
249 views

Strange behavior of RandomVariate for Binomial distribution?

Observe: ...
ciao's user avatar
  • 26k
10 votes
2 answers
200 views

Possible bug in VonMisesDistribution?

Bug introduced in 10.2 or earlier and fixed in 10.3 Observe: ...
ciao's user avatar
  • 26k
2 votes
0 answers
217 views

Mixture of a bivariate distribution defined as a copula

I define a bivariate distribution: ...
corey979's user avatar
  • 24.3k
2 votes
0 answers
115 views

Optimization of custom probability distibutions?

Consider the two tests: Timing[Do[RandomVariate[NormalDistribution[0.5, 0.3]], {200}]] {0.001188, Null} ...
JeffDror's user avatar
  • 1,890
2 votes
1 answer
203 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: ...
AlexPlus's user avatar
0 votes
1 answer
145 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 ...
ben18785's user avatar
  • 3,167
2 votes
0 answers
403 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 ...
Sasha's user avatar
  • 195
4 votes
2 answers
770 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 ...
ben18785's user avatar
  • 3,167
8 votes
1 answer
657 views

Inconsistent DistributionFitTest results?

In pondering this question, I used Mariana's function to generate the following data. ...
Steve's user avatar
  • 1,417
7 votes
1 answer
378 views

RandomVariate does not fill range of PDF of distribution

I've declared my own probability distribution as follows dist[a_, b_] := ProbabilityDistribution[Cos[(b x)/2]^2 Sinc[a x]^2, {x, -400, 400}]; When I try to ...
mrkprc1's user avatar
  • 73
1 vote
1 answer
325 views

Safe values of $\mu$ and $\sigma$ when randomly sampling from a Log-Normal Distribution?

I believe I'm obtaining overflow errors when randomly sampling from a log-normal distribution with the command: RandomVariate[LogNormalDistribution[μ, σ], 1] ...
B.E.'s user avatar
  • 13
2 votes
0 answers
1k 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(...
dabd's user avatar
  • 839
22 votes
2 answers
2k views

Efficient Generation of Random Variates from a Copula Distribution

I have a 7-asset portfolio for which I want to simulate daily log-deltas using a Student T copula. The marginal distributions are all either Stable or TsallisQGaussian. Using NMaximize, I have ...
user6062's user avatar
  • 321
16 votes
1 answer
470 views

RandomVariate returns values outside the support of a PDF

Bug introduced in 8.0.1 and fixed in 10.2.0 Let $X$ be a random variable with pdf: dist = ProbabilityDistribution[1/(Abs[x]*Log[Abs[x]]^2), {x, -E^-2, E^-2}] ...
wolfies's user avatar
  • 8,762