https://github.com/rbeeli/quantutils.jl
Utility functions commonly used in quantitative finance.
https://github.com/rbeeli/quantutils.jl
Last synced: 12 months ago
JSON representation
Utility functions commonly used in quantitative finance.
- Host: GitHub
- URL: https://github.com/rbeeli/quantutils.jl
- Owner: rbeeli
- License: apache-2.0
- Created: 2023-11-19T00:29:20.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2025-07-19T03:17:31.000Z (about 1 year ago)
- Last Synced: 2025-07-19T08:48:46.605Z (about 1 year ago)
- Language: Julia
- Size: 17.6 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# QuantUtils.jl
[](https://opensource.org/licenses/MIT)
Utility functions commonly used in Quantitative Finance and Machine Learning.
The functions make use of multiple dispatch and aim to be type stable for best performance.
The package aims to be lightweight with minimal dependencies.
## Functions
### Combinatorics
```julia
params_combinations(params; filter, shuffle)
```
### Conversion
```julia
nan_to_zero(x)
nan_to_one(x)
nan_to_x(x, nan_value)
```
### Imputation
```julia
ffill(df::AbstractDataFrame, where=isnan; cols=names(df), ignore_cols=nothing, fill=(curr, prev) -> prev)
ffill!(df::AbstractDataFrame, where=isnan; cols=names(df), ignore_cols=nothing, fill=(curr, prev) -> prev)
bfill(df::AbstractDataFrame, where=isnan; cols=names(df), ignore_cols=nothing, fill=(curr, prev) -> prev)
bfill!(df::AbstractDataFrame, where=isnan; cols=names(df), ignore_cols=nothing, fill=(curr, prev) -> prev)
```
### Partitioning
```julia
split_parts(mat::AbstractMatrix, parts; axis=1)
split_parts(vec::AbstractVector, parts; axis=1)
split_parts(df::AbstractDataFrame, parts; axis=1)
split_parts_to_indices(total_length, parts)
```
### Window functions
```julia
rolling_apply(
vec::V,
window::Int,
fn::F
;
step::Int=1,
item_type=eltype(vec),
running::Bool=false,
parallel::Bool=false
) where {V<:AbstractVector,F<:Function}
rolling_apply(
mat::M,
window::Int,
fn::F
;
dim::Int=1, # dimension to apply function along (1=rows, 2=columns)
step::Int=1,
item_type=eltype(mat),
running::Bool=false,
parallel::Bool=false
) where {M<:AbstractMatrix,F<:Function}
```
## Dependencies
- [DataFrames.jl](https://dataframes.juliadata.org/stable/)