Sim

object Sim

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

class Object
trait Matchable
class Any

Value members

Concrete methods

def plotTs[S](ts: Ts[S], title: String)(implicit evidence$3: State[S]): 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 Params
title

Optional figure title

ts

A time series of States

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

Simulate multiple independent realisations from a transition kernel

Simulate multiple independent realisations from a transition kernel

Value Params
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

Returns

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

def times[S](x0: S, t0: Time, timeList: List[Time], stepFun: (S, Time, Time) => S)(implicit evidence$1: State[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 Params
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

Returns

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

def toCsv[S](ts: Ts[S])(implicit evidence$4: State[S]): String

Utility for converting a time series to a CSV string

Utility for converting a time series to a CSV string

Value Params
ts

A time series of States

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 Params
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

Returns

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