Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update and refactor documentation #87

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 44 additions & 12 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,56 @@ makedocs(
),
modules = [DiffFusion],
pages = [
"index.md",
"pages/overview.md",
"pages/simulation_framework.md",
"Home" => "index.md",
"Introduction" => Any[
"introduction/overview.md",
"introduction/simulation_framework.md",
],
"Term Structures" => Any[
"termstructures/termstructures.md",
"termstructures/yield_curves.md",
"termstructures/volatilities.md",
"termstructures/parameters.md",
"termstructures/correlations.md",
"Others" => "termstructures/others.md",
],
"Models" => Any[
"models/rates_models.md",
"models/asset_models.md",
"models/futures_models.md",
"models/credit_models.md",
"models/cross_asset_models.md",
"models/models.md",
],
#
"termstructures/termstructures.md",
"models/models.md",
"models/rates_models.md",
"simulations/simulations.md",
"paths/paths.md",
"payoffs/payoffs.md",
"products/products.md",
"Pricing Configuration" => Any[
"pricing_configuration/context.md",
"pricing_configuration/paths.md",
],
"Products" => Any[
"products/cash_flows.md",
"products/products.md",
"products/swaptions.md",
],
"Scenarios" => Any[
"scenarios/scenario_generation.md",
"scenarios/exposure_calculation.md",
"scenarios/collateral_simulation.md",
],
"Payoffs" => Any[
"payoffs/payoffs.md",
"payoffs/rates_payoffs.md",
"payoffs/asset_payoffs.md",
"payoffs/amc_payoffs.md",
],
"sensitivities/sensitivities.md",
"analytics/analytics.md",
#
"examples/examples.md",
"serialisation/serialisation.md",
"utils/utils.md",
"pages/additional_functions.md",
"pages/function_index.md",
"additional_functions/additional_functions.md",
"function_index/function_index.md",
],
warnonly = [:missing_docs, ],
)
Expand Down
83 changes: 6 additions & 77 deletions docs/src/analytics/analytics.md
Original file line number Diff line number Diff line change
@@ -1,88 +1,17 @@
# Analytics Functions
# Analytics

In this section we document methods for instrument pricing, exposure and collateral simulation.
In this section we document additional analytic modelling functions.

```@docs
DiffFusion.ScenarioCube
```

```@docs
DiffFusion.scenarios
```

```@docs
DiffFusion.join_scenarios
```

```@docs
DiffFusion.interpolate_scenarios
```

```@docs
DiffFusion.concatenate_scenarios
```

```@docs
DiffFusion.aggregate
```

```@docs
DiffFusion.expected_exposure
```

```@docs
DiffFusion.potential_future_exposure
```

```@docs
DiffFusion.valuation_adjustment
```

## Collateral Modelling

This section contains methods for collateralised exposure calculation.

We follow the approaches in A. Green, XVA, 2016.


```@docs
DiffFusion.collateral_call_times
```

```@docs
DiffFusion.market_values_for_csa
```

```@docs
DiffFusion.collateral_values_for_csa
```

```@docs
DiffFusion.effective_collateral_values
```

```@docs
DiffFusion.collateralised_portfolio
```

## Pricing Analytics

```@docs
DiffFusion.model_price
```

```@docs
DiffFusion.model_price_and_deltas
```
## Reference Rate Covariance Calculations

```@docs
DiffFusion.model_price_and_vegas
DiffFusion.reference_rate_scaling
```

```@docs
DiffFusion.model_price_and_deltas_vector
DiffFusion.reference_rate_covariance
```

```@docs
DiffFusion.model_price_and_vegas_vector
DiffFusion.reference_rate_volatility_and_correlation
```
4 changes: 3 additions & 1 deletion docs/src/examples/examples.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Examples (Module) Functions
# Example Models and Portfolios

We add example models, term structures, pricing context and product configurations in an `Examples` sub-module. The examples are encoded as YAML files. They should help users to easily set up simulations for ad-hoc testing and analysis.

In this section we document data and functions to work with the product and model examples.

Expand Down
10 changes: 5 additions & 5 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ A basic one-factor Gaussian interest rate model can be set up as follows:
model = DiffFusion.gaussian_hjm_model("mdl/HJM1F", δ, χ, σ, nothing, nothing)
```

Details on the setup of model parameters are documented in the [Term Structures Functions](@ref) section. Available models are documented in the [Models Functions](@ref) section.
Details on the setup of model parameters are documented in the [Interest Rates Models](@ref) section. Available models are documented in the Models section.

### Monte Carlo Simulation

Expand All @@ -83,7 +83,7 @@ n_paths = 2^10 # number of simulated paths
sim = DiffFusion.simple_simulation(model, ch, times, n_paths)
```

Further details on Monte Carlo simulation methods are documented in the [Simulations Functions](@ref) section.
Further details on Monte Carlo simulation methods are documented in the [Monte Carlo Simulations](@ref) section.

### Monte Carlo *Path* Construction

Expand Down Expand Up @@ -123,7 +123,7 @@ And a path combines simulation, term structures and context.
path = DiffFusion.path(sim, ts, ctx)
```

`Context` and `Path` objects are further documented in the [Monte Carlo Paths Functions](@ref) section.
`Context` and `Path` objects are further documented in the [Pricing Context](@ref) section and the [Simulated Paths](@ref) section.

### Financial Instrument Setup

Expand Down Expand Up @@ -186,7 +186,7 @@ fixed_leg = DiffFusion.cashflow_leg(

A financial instrument is a list of one or more cash flow legs.

More details on available cash flows and cash flow legs are documented in the [Products Functions](@ref) section.
More details on available cash flows and cash flow legs are documented in the [Cash Flow and Coupons](@ref) section.

### Scenario Valuation

Expand Down Expand Up @@ -229,7 +229,7 @@ display(ee)
# 0.0 7.98524 9.44371 147.817 148.527 0.0 0.0
```

Scenario valuations are further documented in the [Analytics Functions](@ref) section.
Scenario valuations are further documented in the [Scenarios](@ref) section.

## Further Examples

Expand Down
File renamed without changes.
56 changes: 56 additions & 0 deletions docs/src/models/asset_models.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Asset Models (FX/Equity/Inflation)

## Asset Model Types

```@docs
DiffFusion.AssetModel
```

### Lognormal Model

```@docs
DiffFusion.LognormalAssetModel
```

```@docs
DiffFusion.lognormal_asset_model
```

### CEV Model

```@docs
DiffFusion.CevAssetModel
```

```@docs
DiffFusion.cev_asset_model
```

## Model Functions for Payoff Evaluation

```@docs
DiffFusion.log_asset
```

```@docs
DiffFusion.log_asset_convexity_adjustment
```

## Additional Asset Model Functions

```@docs
DiffFusion.asset_volatility
```

```@docs
DiffFusion.correlation_holder(m::DiffFusion.AssetModel)
```

```@docs
DiffFusion.quanto_drift
```

```@docs
DiffFusion.asset_variance
```

42 changes: 42 additions & 0 deletions docs/src/models/credit_models.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Credit Spread Models

## Model Types

```@docs
DiffFusion.CoxIngersollRossModel
```

```@docs
DiffFusion.cox_ingersoll_ross_model
```

## Model Functions for Simulation

```@docs
DiffFusion.cir_z0
```

```@docs
DiffFusion.cir_chi
```

```@docs
DiffFusion.cir_theta
```

```@docs
DiffFusion.cir_sigma
```

```@docs
DiffFusion.cir_moments
```

```@docs
DiffFusion.cir_lognormal_approximation
```

```@docs
DiffFusion.func_Theta_Sigma
```

23 changes: 23 additions & 0 deletions docs/src/models/cross_asset_models.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Cross Asset Hybrid Models

## Cross Asset Hybrid Model Types

```@docs
DiffFusion.CompositeModel
```

```@docs
DiffFusion.SimpleModel
```

```@docs
DiffFusion.simple_model
```

```@docs
DiffFusion.DiagonalModel
```

```@docs
DiffFusion.diagonal_model
```
18 changes: 18 additions & 0 deletions docs/src/models/futures_models.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Future Price Models

## Future Price Model Types

```@docs
DiffFusion.MarkovFutureModel
```

```@docs
DiffFusion.markov_future_model
```

## Model Functions for Payoff Evaluation

```@docs
DiffFusion.log_future
```

Loading
Loading