Skip to content

Commit

Permalink
Rebuild README
Browse files Browse the repository at this point in the history
  • Loading branch information
imanuelcostigan committed Sep 7, 2019
1 parent e8c117e commit dfd9e9c
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 19 deletions.
12 changes: 12 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,16 @@ interpolate_fwds(zc, ymd(20170331), ymd(20170630))
interpolate_dfs(zc, ymd(20170331), ymd(20170630))
```

Basic support for creating and interpolating volatility surfaces is possible:

```{r}
vs <- build_vol_surface()
at <- tibble::tibble(
maturity = as.Date(c("2020-03-31", "2021-03-31")),
smile = c(0.40, 0.80)
)
interpolate(vs, at)
```


Further details can be found in this package's help pages and vignettes (`vignette(package = "fmbasics")`)
63 changes: 44 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@

<!-- README.md is generated from README.Rmd. Please edit that file -->
fmbasics - Financial Market Building Blocks
===========================================

[![CRAN\_Status\_Badge](https://www.r-pkg.org/badges/version/fmbasics)](https://cran.r-project.org/package=fmbasics) [![Travis-CI Build Status](https://travis-ci.org/imanuelcostigan/fmbasics.svg?branch=master)](https://travis-ci.org/imanuelcostigan/fmbasics) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/imanuelcostigan/fmbasics?branch=master&svg=true)](https://ci.appveyor.com/project/imanuelcostigan/fmbasics) [![Coverage Status](https://img.shields.io/codecov/c/github/imanuelcostigan/fmbasics/master.svg)](https://codecov.io/github/imanuelcostigan/fmbasics?branch=master)
# fmbasics - Financial Market Building Blocks

Implements basic financial market objects like currencies, currency pairs, interest rates and interest rate indices. You will be able to use Benchmark instances of these objects which have been defined using their most common conventions or those defined by International Swap Dealer Association (ISDA, <https://www.isda.org>) legal documentation.
[![CRAN\_Status\_Badge](https://www.r-pkg.org/badges/version/fmbasics)](https://cran.r-project.org/package=fmbasics)
[![Travis-CI Build
Status](https://travis-ci.org/imanuelcostigan/fmbasics.svg?branch=master)](https://travis-ci.org/imanuelcostigan/fmbasics)
[![AppVeyor Build
Status](https://ci.appveyor.com/api/projects/status/github/imanuelcostigan/fmbasics?branch=master&svg=true)](https://ci.appveyor.com/project/imanuelcostigan/fmbasics)
[![Coverage
Status](https://img.shields.io/codecov/c/github/imanuelcostigan/fmbasics/master.svg)](https://codecov.io/github/imanuelcostigan/fmbasics?branch=master)

Basic objects
-------------
Implements basic financial market objects like currencies, currency
pairs, interest rates and interest rate indices. You will be able to use
Benchmark instances of these objects which have been defined using their
most common conventions or those defined by International Swap Dealer
Association (ISDA, <https://www.isda.org>) legal documentation.

You can create instances of key currencies and currency pairs (and of course create your own implementations):
## Basic objects

You can create instances of key currencies and currency pairs (and of
course create your own implementations):

``` r
library("fmdates")
Expand Down Expand Up @@ -51,10 +61,11 @@ to_maturity(as.Date("2017-01-20"), USDLIBOR(months(3)))
#> [1] "2017-04-20"
```

Interest rates and discount factors
-----------------------------------
## Interest rates and discount factors

You can create and perform basic manipulation of interest rates and discount factors:
You can create and perform basic manipulation of interest rates and
discount
factors:

``` r
rr <- InterestRate(value = 0.01, compounding = Inf, day_basis = "act/365")
Expand All @@ -70,27 +81,41 @@ as_InterestRate(dd, compounding = Inf, day_basis = "act/360")
#> <InterestRate> 7.088675%, CONTINUOUS, ACT/360
```

Pricing objects
---------------
## Pricing objects

It is also possible to create and interpolate on zero coupon interest rate curves:
It is also possible to create and interpolate on zero coupon interest
rate curves:

``` r
zc <- build_zero_curve()
plot(zc$pillar_times, zc$pillar_zeros, xlab = 'Years', ylab = 'Zero')
```

![](inst/README-unnamed-chunk-7-1.png)
![](inst/README-unnamed-chunk-7-1.png)<!-- -->

``` r
interpolate(zc, year_frac(zc$reference_date, ymd(20170331), "act/365"))
#> [1] 0.0187453
#> [1] 0.01858073
interpolate_zeros(zc, ymd(20170331))
#> <InterestRate> 1.87453%, CONTINUOUS, ACT/365
#> <InterestRate> 1.858073%, CONTINUOUS, ACT/365
interpolate_fwds(zc, ymd(20170331), ymd(20170630))
#> <InterestRate> 1.837274%, SIMPLE, ACT/365
#> <InterestRate> 1.837645%, SIMPLE, ACT/365
interpolate_dfs(zc, ymd(20170331), ymd(20170630))
#> <DiscountFactor> 0.995440285935839, 2017-03-31--2017-06-30
#> <DiscountFactor> 0.995439369532595, 2017-03-31--2017-06-30
```

Basic support for creating and interpolating volatility surfaces is
possible:

``` r
vs <- build_vol_surface()
at <- tibble::tibble(
maturity = as.Date(c("2020-03-31", "2021-03-31")),
smile = c(0.40, 0.80)
)
interpolate(vs, at)
#> [1] 0.6001969 0.6042421
```

Further details can be found in this package's help pages and vignettes (`vignette(package = "fmbasics")`)
Further details can be found in this package’s help pages and vignettes
(`vignette(package = "fmbasics")`)
Binary file modified inst/README-unnamed-chunk-7-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit dfd9e9c

Please sign in to comment.