vasicek

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 7, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Calibrate

func Calibrate(v *Vasicek, ts term.Structure) error

Calibrate calculates the parameters of the Vasicek model

Types

type Vasicek

type Vasicek struct {
	// R0
	R0 float64
	// Rbar
	Rbar float64
	// Gamma
	Gamma float64
	// Sigma is the standard deviation of the first difference of the short term interest rate
	Sigma float64
	// T is the maturity (up to which to calculate the interes rates)
	T float64
	// N represents number of steps
	N int
	// Rng is the random number generator (NormFloat64)
	Rng *rand.Rand
	// Payoff returns the discounted payoff for the given simulated rates
	Payoff func([]float64) float64
}

Vasicek implements the basic Vasicek interest rate model

func New

func New(ts term.Structure, sigma, t float64, n int, payoff func([]float64) float64) (*Vasicek, error)

New creates a new Vasicek model

func (*Vasicek) Measurement

func (v *Vasicek) Measurement() float64

Measurement implements the model interface for the Monte Carlo engine

func (*Vasicek) Z

func (v *Vasicek) Z(r, t, T float64) float64

Z returns the Vasicek discount factor Z(r;t,T) Source: P. Veronesi, Fixed Income Securities, p. 539, Eq. 15.28

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL