qfl 0.1.1

A Rust library of various functions and tools for Statistics, Quant Finance, Stochastic Modelling, and other needs.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// For calculating interest amounts

pub fn compound_interest_cont(principal:f64, rate:f64, time:f64)-> f64
{
    principal * f64::exp(rate*time)
}

pub fn compound_interest_periodic(principal:f64, rate:f64, periods:f64, periods_pa:f64) -> f64
{
    principal * f64::powf(1f64+(rate/periods_pa), periods*periods_pa)
}

pub fn simple_interest(principal:f64, rate:f64, time:f64) ->f64
{
    principal * rate * time + principal
}