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

Add models for rates and tradeable assets #6

Merged
merged 1 commit into from
Jul 22, 2023
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
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
ProgressBars = "49802e3a-d2f1-5c88-81d8-b72133a6f568"
QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

[compat]
Interpolations = "0.14"
Expand Down
2 changes: 2 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
ProgressBars = "49802e3a-d2f1-5c88-81d8-b72133a6f568"
QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
231 changes: 231 additions & 0 deletions docs/src/models/models.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,234 @@

In this section we document models for various risk factors.

## Data Structures and Constructors

```@docs
DiffFusion.Model
```

```@docs
DiffFusion.ComponentModel
```

```@docs
DiffFusion.AssetModel
```

```@docs
DiffFusion.LognormalAssetModel
```

```@docs
DiffFusion.lognormal_asset_model
```

```@docs
DiffFusion.SeparableHjmModel
```

```@docs
DiffFusion.GaussianHjmModel
```

```@docs
DiffFusion.gaussian_hjm_model
```

## State Variable

A model allows to simulate a stochastic process $\left(X_t\right)$. For a given $t$ the vector $X_t$ is represented by a `ModelState`.

```@docs
DiffFusion.ModelState
```

```@docs
DiffFusion.model_state
```

```@docs
DiffFusion.alias_dictionary
```

## Auxilliary Methods

```@docs
DiffFusion.alias(m::DiffFusion.Model)
```

```@docs
DiffFusion.model_alias
```

```@docs
DiffFusion.state_alias
```

```@docs
DiffFusion.factor_alias
```

```@docs
DiffFusion.parameter_grid
```

## Model Functions for Payoff Evaluation

```@docs
DiffFusion.log_asset
```

```@docs
DiffFusion.log_bank_account
```

```@docs
DiffFusion.log_zero_bond
```

```@docs
DiffFusion.log_asset_convexity_adjustment
```

```@docs
DiffFusion.log_future
```

```@docs
DiffFusion.forward_rate_variance
```

## Model Functions for Simulation

```@docs
DiffFusion.Theta
```

```@docs
DiffFusion.H_T
```

```@docs
DiffFusion.Sigma_T
```

```@docs
DiffFusion.state_dependent_Theta
```

```@docs
DiffFusion.state_dependent_H
```

```@docs
DiffFusion.state_dependent_Sigma
```

```@docs
DiffFusion.state_alias_H
```

```@docs
DiffFusion.factor_alias_Sigma
```

```@docs
DiffFusion.covariance
```

```@docs
DiffFusion.volatility_and_correlation
```

```@docs
DiffFusion.simulation_parameters
```

```@docs
DiffFusion.diagonal_volatility
```

## Additional Asset Model Functions

```@docs
DiffFusion.asset_volatility
```

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

```@docs
DiffFusion.quanto_drift
```

```@docs
DiffFusion.asset_variance
```

## Additional Rates Model Functions

```@docs
DiffFusion.func_y
```

```@docs
DiffFusion.chi_hjm
```

```@docs
DiffFusion.benchmark_times
```

```@docs
DiffFusion.H_hjm
```

```@docs
DiffFusion.G_hjm
```

```@docs
DiffFusion.benchmark_times_scaling
```

```@docs
DiffFusion.func_Theta_x
```

```@docs
DiffFusion.func_Theta_x_integrate_y
```

```@docs
DiffFusion.func_Theta_s
```

```@docs
DiffFusion.func_Theta
```

```@docs
DiffFusion.func_H_T
```

```@docs
DiffFusion.func_H_T_dense
```

```@docs
DiffFusion.func_Sigma_T
```

```@docs
DiffFusion.GaussianHjmModelVolatility
```

```@docs
DiffFusion.swap_rate_instantaneous_covariance
```

```@docs
DiffFusion.swap_rate_variance
```
10 changes: 10 additions & 0 deletions src/DiffFusion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ using Interpolations
using LinearAlgebra
using ProgressBars
using Random
using QuadGK
using SparseArrays


"""
Expand All @@ -22,7 +24,15 @@ include("termstructures/parameter/ParameterTermstructures.jl")
include("termstructures/rates/YieldTermstructures.jl")
include("termstructures/volatility/VolatilityTermstructures.jl")

include("models/Model.jl")
include("models/asset/AssetModel.jl")
include("models/asset/LognormalAssetModel.jl")
include("models/rates/SeparableHjmModel.jl")
include("models/rates/GaussianHjmModel.jl")

include("utils/Integrations.jl")
include("utils/InterpolationMethods.jl")



end
Loading