General definitions

Annoying warnings

Off[General :: spell] ; Off[General :: spell1] ; Off[Part :: partd] ;

Load packages

Required by all modeling techniques

<<Statistics`MultinormalDistribution` ; <<Graphics`Colors` ; <<Graphics`Graphics` ;

Histogram modeling

<<Statistics`DataManipulation` ; <<DiscreteMath`ComputationalGeometry` ;

Gaussian modeling

<<Graphics`InequalityGraphics` ; <<Graphics`ImplicitPlot` ; <<Graphics`ContourPlot3D` ; <<Graphics`Animation` ;

Random variable generation

Uniform random variable

ru[range_] := Random[Real, {-range, range}] ;

ru2[range_] := Random[Real, {range[[1]], range[[2]]}] ;

Two-dimensional uniform random variable

r2[range_] := {ru[range], ru[range]} ;

Two-dimensional Gaussian random variable

rg[μ_, Σ_] := Random[MultinormalDistribution[μ, Σ]] ;

Bounded two-dimensional Gaussian random variable

rgBounded[{μ_, Σ_}, pr_] := Module[{xt, yt, flag, xmin, xmax, ymin, ymax}, & ... lt; yt < ymax, flag = 1, {xt, yt} = rg[μ, Σ]] ] ;  {xt, yt} ]

General helper functions

Distance measure between two vectors

dist[a_, b_] := Sqrt[(a - b) . (a - b)] ;

Convergence function for iterative algorithms

conv[param1_, param2_] := Module[{df}, df = Flatten[param1] - Flatten[param2] ; Sqrt[(Plus @@ (df . df))/Length[df]] ] ;

Visualization definitions

Short-cuts

nS = DisplayFunctionIdentity ; yS = DisplayFunction$DisplayFunction ; imSize = ImageSize400 ;

Two-dimensional data plotting

PlotData2D[x_, pr_, style_:Red, opt___] := Module[{xmin, xmax, ymin, ymax, glist},  ... 754;Automatic, PlotRange {{xmin, xmax}, {ymin, ymax}}, FrameTrue, opt] ] ;


Created by Mathematica  (September 8, 2003)