Code covered by the BSD License
-
birthdeath(npoints, flambda, ...
BIRTHDEATH generate a trajectory of a birth-death process
-
bm3plot(npoints, sigma)
% BM3PLOT Generate and plot a 3-dimensional Brownian motion
-
brownian(npoints, sigma)
BROWNIAN generate and plot an aproximation to Brownian motion.
-
galtonwatson(nmbgen, initsize...
GALTONWATSON generates a trajectory of a Galton-Watson branching process
-
moran(initsize, popsize)
MORAN generates a trajectory of a Moran type process
-
poisson2d(lambda)
POISSON2D generate and plot Poisson process in the plane
-
poisson3d(lambda)
POISSON3D generate and plot Poisson process in the unit cube
-
poissonjp(njumps, lambda, ntr...
POISSONJP generate and plot a number of trajectories of a Poisson
-
poissonti(tmax, lambda, nproc...
POISSONTI generate N independent Poisson processes as matrix
-
ranwalk(npoints, p)
RANWALK generate and plot a trajectory of a random walk which
-
ranwalk2d(npoints, p)
-
ranwalk3d(npoints, p)
-
rw3plot(npoints, ntrajs, p)
RW3PLOT generate and plot some trajectories of the process
-
View all files
from
Simulation of Stochastic Processes
by Ingemar Kaj Raimundas Gaigalas
Simulates and plots trajectories of simple stochastic processes.
|
| brownian(npoints, sigma)
|
function [bmproc] = brownian(npoints, sigma)
% BROWNIAN generate and plot an aproximation to Brownian motion.
% Generates a random walk with normally distributed jumps
%
% [bmproc] = brownian(npoints [, sigma])
%
% Inputs: npoints - length of the trajectory
% sigma - optional, the norming constant (standard
% deviation of B(1)). Default 1.
%
% Outputs: bmproc - trajectory of the process
% Authors: R.Gaigalas, I.Kaj
% v1.2 04-Oct-02
% set default parameter values
if (nargin==1)
sigma = 1;
end
% generate a sample from a Gaussian distribution and sum up
bmproc = [0 cumsum(sigma.*randn(1, npoints-1))];
% plot the process
plot([0:npoints-1], bmproc);
|
|
Contact us at files@mathworks.com