1; # Octave script file, not a function
N = 100;
# number of end-points of the grid including T
T = 1;
# length of the interval [0, T] in time units
Delta = T/N;
# time increment
W = zeros(1, N+1);
# initialization of the vector W approximating
# Wiener process
t = (0:Delta:T);
W(2:N+1) = cumsum( sqrt(Delta) * stdnormal_rnd(1,N));
plot(t, W)
axis([0,1,-1,1])
title("Wiener process")
## Octave is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public
## License as published by the Free Software Foundation;
## either version 3 of the License, or (at your option) any
## later version.
##
## Octave is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied
## warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
## PURPOSE. See the GNU General Public License for more
## details.
##
## You should have received a copy of the GNU General Public
## License along with Octave; see the file COPYING. If not,
## see .
## NAME: definition.m
##
## USAGE: within Octave at interactive prompt
## definition
##
## REQUIRED ARGUMENTS: none
##
## OPTIONS: none
## DESCRIPTION: Simulation of Wiener process using the
## definition as independent increments having
## normal distribution with variance sqrt(Delta)
## DIAGNOSTICS: none
## CONFIGURATION AND ENVIRONMENT: none
## DEPENDENCIES: none
## INCOMPATIBILITIES: None known
## PROVENANCE: Created Sun Mar 3, 2013 7:38 AM
## BUGS AND LIMITATIONS: None known
## FEATURES AND POTENTIAL IMPROVEMENTS: Note that the vertical axis limits
## are -1 and +1, so the probability is about 0.68 that the endpoint
## W(101) will be in the plot frame. Plots may be truncated because of
## the choice of plot frame. This is intentional to illustrate an
## aspect of the Wiener process.
## AUTHOR: Steve Dunbar
## VERSION: Version 1.0 as of Sun Mar 3, 2013 7:44 AM
## KEYWORDS: Winer process, Brownian motion
## AUTHOR
# Prevent Octave from thinking that this
# is a function file:
1;