Sim

smfsb.Sim
object Sim

Functions for simulating data associated with a Markov process given an appropriate transition kernel.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Sim.type

Members list

Value members

Concrete methods

def plotTs[S : State](ts: Ts[S], title: String): Unit

A function for producing a very simple plot of a time series, useful for a quick eye-balling of simulation output. Called purely for the side-effect of rendering a plot on the console.

A function for producing a very simple plot of a time series, useful for a quick eye-balling of simulation output. Called purely for the side-effect of rendering a plot on the console.

Value parameters

title

Optional figure title

ts

A time series of States

Attributes

def sample[S : State](n: Int, x0: S, t0: Time, deltat: Time, stepFun: (S, Time, Time) => S): List[S]

Simulate multiple independent realisations from a transition kernel

Simulate multiple independent realisations from a transition kernel

Value parameters

deltat

The time interval over which to simulate the process

n

The number of realisations required

stepFun

The transition kernel to use

t0

The intial time

x0

The initial state

Attributes

Returns

A List of realisations of the kernel at time t0+deltat

def times[S : State](x0: S, t0: Time, timeList: List[Time], stepFun: (S, Time, Time) => S): Ts[S]

Use a transition kernel to simulate states on an irregular time grid

Use a transition kernel to simulate states on an irregular time grid

Value parameters

stepFun

The transition kernel, such as output by one of the functions in Sim

t0

Initial time

timeList

A list of times where the state of the process is required

x0

Initial state

Attributes

Returns

A time series of simulated states at the required times corresponding to a single realisation of the underlying stochastic process

def toCsv[S : State](ts: Ts[S]): String

Utility for converting a time series to a CSV string

Utility for converting a time series to a CSV string

Value parameters

ts

A time series of States

Attributes

Returns

A CSV string

def ts[S](x0: S, t0: Time, tt: Time, dt: Time, stepFun: (S, Time, Time) => S): Ts[S]

Use a transition kernel to simulate states on a regular time grid

Use a transition kernel to simulate states on a regular time grid

Value parameters

dt

The time step of the output time grid

stepFun

The transition kernel, such as output by one of the functions in Sim

t0

Initial time

tt

The terminal time

x0

Initial state

Attributes

Returns

A time series of simulated states corresponding to a single realisation of the underlying stochastic process