  This paper proposes an algorithm to calculate the maximal probability of
unsafety with respect to trajectories of a stochastic process and a hazard set.
The unsafe probability estimation problem is cast as a primal-dual pair of
infinite-dimensional linear programs in occupation measures and continuous
functions. This convex relaxation is nonconservative (to the true probability
of unsafety) under compactness and regularity conditions in dynamics. The
continuous-function linear program is linked to existing probability-certifying
barrier certificates of safety. Risk contours for initial conditions of the
stochastic process may be generated by suitably modifying the objective of the
continuous-function program, forming an interpretable and visual representation
of stochastic safety for test initial conditions. All infinite-dimensional
linear programs are truncated to finite dimension by the Moment-Sum-of-Squares
hierarchy of semidefinite programs. Unsafe-probability estimation and risk
contours are generated for example stochastic processes.
