Skip to content
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
3 changes: 3 additions & 0 deletions .github/workflows/FormatCheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: julia-actions/setup-julia@v2
with:
version: '1'
- uses: fredrikekre/runic-action@v1
with:
version: '1'
2 changes: 1 addition & 1 deletion docs/pages.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Put in a separate page so it can be used by SciMLDocs.jl

pages = ["Home" => "index.md", "diffeqfinancial.md"]
pages = ["Home" => "index.md", "Analytical Solutions" => "analytics.md", "API Reference" => "diffeqfinancial.md"]
62 changes: 62 additions & 0 deletions docs/src/analytics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Analytical Solutions

DiffEqFinancial.jl provides analytical (closed-form) solutions for the mean,
variance, and standard deviation of the supported financial stochastic processes.
These functions provide exact results without requiring Monte Carlo simulation,
offering significant performance and accuracy benefits.

## Geometric Brownian Motion

The GBM process: ``dX = \mu X \, dt + \sigma X \, dW_t``

```@docs
gbm_mean
gbm_variance
gbm_std
```

## Ornstein-Uhlenbeck Process

The OU process: ``dX = a(r - X) \, dt + \sigma \, dW_t``

```@docs
ou_mean
ou_variance
ou_std
ou_stationary_mean
ou_stationary_variance
```

## Cox-Ingersoll-Ross (CIR) Process

The CIR process: ``dr = \kappa(\theta - r) \, dt + \sigma \sqrt{r} \, dW_t``

```@docs
cir_mean
cir_variance
cir_std
cir_stationary_mean
cir_stationary_variance
```

## Black-Scholes Log-Price

The log-price process: ``d \ln S = (r - \sigma^2/2) \, dt + \sigma \, dW_t``

```@docs
bs_log_mean
bs_log_variance
bs_log_std
```

## Heston Model

The Heston stochastic volatility model:
``dS = \mu S \, dt + \sqrt{v} S \, dW_1``,
``dv = \kappa(\Theta - v) \, dt + \sigma \sqrt{v} \, dW_2``

```@docs
heston_mean
heston_variance_mean
heston_variance_variance
```
8 changes: 8 additions & 0 deletions src/DiffEqFinancial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ using Markdown: @doc_str
import RandomNumbers: Xorshifts

include("problems.jl")
include("analytics.jl")

export HestonProblem, BlackScholesProblem, GeneralizedBlackScholesProblem,
ExtendedOrnsteinUhlenbeckProblem, OrnsteinUhlenbeckProblem,
Expand All @@ -16,4 +17,11 @@ export HestonProblem, BlackScholesProblem, GeneralizedBlackScholesProblem,
CIRProblem,
CIRNoise

# Analytical solutions and moment functions
export gbm_mean, gbm_variance, gbm_std,
ou_mean, ou_variance, ou_std, ou_stationary_mean, ou_stationary_variance,
cir_mean, cir_variance, cir_std, cir_stationary_mean, cir_stationary_variance,
bs_log_mean, bs_log_variance, bs_log_std,
heston_mean, heston_variance_mean, heston_variance_variance

end # module
Loading
Loading