RandomFunction

RandomFunction[proc,{tmin,tmax}]

generates a pseudorandom function from the process proc from tmin to tmax.

RandomFunction[proc,{tmin,tmax,dt}]

generates a pseudorandom function from tmin to tmax in steps of dt.

RandomFunction[proc,, n]

generates an ensemble of n pseudorandom functions.

Details and Options

  • RandomFunction returns a TemporalData object that can be used to extract several properties including the paths consisting of time-value pairs {{t1,x[t1]},}.
  • For discrete-time processes such as BinomialProcess or ARMAProcess, the step dt is taken to be 1.
  • For continuous-time processes with jumps, such as PoissonProcess and QueueingProcess, the step dt is random and given by the process itself.
  • For continuous-time processes without jumps, such as WienerProcess and ItoProcess, an explicit dt needs to be given.
  • RandomFunction gives a different random function whenever you run the Wolfram Language. You can start with a particular seed, using SeedRandom.
  • The following options can be given:
  • MethodAutomaticwhat method to use
    WorkingPrecisionAutomaticprecision used in internal computations
  • With the setting WorkingPrecision->p, random numbers of precision p will be generated.
  • Special settings for Method are documented under the individual random process reference pages.

Examples

open allclose all

Basic Examples  (5)

Simulate a discrete-time and discrete-state process:

Simulate a continuous-time and discrete-state process:

Simulate a discrete-time and continuous-state process:

Simulate a continuous-time and continuous-state process:

Simulate an ensemble of 10 paths:

Scope  (21)

Basic Uses  (6)

RandomFunction returns a TemporalData object:

Obtain the random path:

Simulate a vector-valued process:

Path up to time 10:

Visualize the path on the plane:

Estimate the parameters for a random process using a sample path:

Use a simulation to find the expected path:

Calculate the mean for each time stamp:

Use a simulation to find confidence bands for a random path:

Calculate the standard error bands for each time stamp:

Simulate an ensemble of 1000 paths:

Compute data slices from paths and plot their distribution shapes:

Compute slice distributions at the same time stamps and plot their distribution shapes:

Parametric Processes  (3)

Simulate a Bernoulli process:

Simulate a Wiener process:

Simulate a compound Poisson process with an exponential jump size distribution:

Queueing Processes  (2)

Simulate an M/M/1 queue with different arrival and service rates:

Simulate a closed queueing network:

Finite Markov Processes  (1)

Simulate a discrete-time finite Markov process:

Simulate a discrete-time hidden Markov process:

Time Series Processes  (5)

Simulate a moving-average process:

Simulate an autoregressive process:

Simulate an autoregressive moving-average process with given precision:

Simulate a few integrated autoregressive moving-average processes:

Simulate a vector-valued SARIMA time series:

Create a 3D sample path function with time:

The color function depends on time:

Stochastic Differential Equation Processes  (2)

Simulate an Ito process:

Simulate a Stratonovich process:

Transformations of Random Processes  (2)

Square of a Poisson process:

Simulate the process:

Sum of a Wiener process and a geometric Brownian motion process:

Simulate the process:

Options  (1)

WorkingPrecision  (1)

Generate a sample path with default machine precision:

Use WorkingPrecision to generate a sample path with higher precision:

Applications  (4)

Visualize a transformed process:

Simulate the process:

Simulate solutions of the stochastic differential equation :

Define the values of the parameters:

Simulate the Wiener process paths:

The solution as function of a path:

Estimate unknown slice distribution of a random process:

Probability density function of slice distribution is not known in closed form:

Generate a random sample of paths:

Extract values from all paths at time :

Visualize its probability density function:

Test if it fits a standard normal distribution:

Approximate an ARIMAProcess with fixed initial conditions by an ARMAProcess:

Use sample paths to assess the approximation:

Properties & Relations  (1)

RandomFunction generates a path for a random process:

Use RandomVariate to generate a sample for a time slice of the process:

Use Histogram to estimate probability density:

Possible Issues  (3)

The length of a step must be smaller than the domain length:

Use a step length less than 1 to get a sample path:

Continuous-time processes require a step to be specified:

Specify a step:

Discrete-time processes do not accept a step specification:

Step is 1 by default:

Neat Examples  (3)

Simulate a WienerProcess in two dimensions:

Simulate a symmetric random walk in 2D:

In 3D:

Simulate a weakly stationary three-dimensional ARMAProcess:

Non-weakly stationary process, starting at the origin:

Introduced in 2012
 (9.0)