-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathCargo.toml
More file actions
402 lines (349 loc) · 11 KB
/
Cargo.toml
File metadata and controls
402 lines (349 loc) · 11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
[workspace]
members = [
"stochastic-rs-core",
"stochastic-rs-distributions",
"stochastic-rs-stochastic",
"stochastic-rs-copulas",
"stochastic-rs-stats",
"stochastic-rs-quant",
"stochastic-rs-ai",
"stochastic-rs-viz",
"stochastic-rs-py",
]
[workspace.package]
version = "2.2.0"
[workspace.dependencies]
# Internal crates
stochastic-rs-core = { path = "stochastic-rs-core", version = "2.2" }
stochastic-rs-distributions = { path = "stochastic-rs-distributions", version = "2.2" }
stochastic-rs-stochastic = { path = "stochastic-rs-stochastic", version = "2.2" }
stochastic-rs-copulas = { path = "stochastic-rs-copulas", version = "2.2" }
stochastic-rs-stats = { path = "stochastic-rs-stats", version = "2.2" }
stochastic-rs-quant = { path = "stochastic-rs-quant", version = "2.2" }
stochastic-rs-ai = { path = "stochastic-rs-ai", version = "2.2" }
stochastic-rs-viz = { path = "stochastic-rs-viz", version = "2.2" }
# Math / numerical core
ndarray = { version = "0.17.2", features = ["rayon", "matrixmultiply-threading"] }
ndarray-linalg = { version = "0.18.1", default-features = false }
ndarray-npy = "0.10.0"
ndarray-rand = "0.16.0"
ndarray-stats = "0.7.0"
ndrustfft = "0.6.2"
num-complex = { version = "0.4.6", features = ["rand"] }
num-traits = "0.2.19"
nalgebra = "0.33.2"
# RNG / parallel / SIMD
rand = "0.9.2"
rand_distr = "0.5.1"
rayon = "1.11.0"
wide = "1.4.0"
# Statistics / fitting / optimisation
# `statrs` is dev-deps only — used for cross-validating our closed-form
# `DistributionExt` impls. Production code never delegates to it.
statrs = "0.18.0"
kendalls = "1.0.0"
linreg = "0.2.0"
levenberg-marquardt = "0.14.0"
argmin = "0.11.0"
argmin-math = { version = "0.5", features = ["ndarray_latest-nolinalg", "vec"] }
gauss-quad = "0.3.1"
quadrature = "0.1.2"
roots = "0.0.8"
slsqp = "1.0.0"
scilib = "1.0.0"
sci-rs = "0.4.1"
owens-t = "0.1.5"
# General utility
anyhow = "1.0.89"
either = "1.15.0"
parking_lot = "0.12.5"
ordered-float = "5.0.0"
chrono = "0.4.38"
flate2 = "1.1.2"
# Pricing-specific
implied-vol = "2.0.0"
# Visualisation
plotly = { version = "0.10.0", features = ["plotly_ndarray"] }
# Native math (gated)
openblas-src = { version = "0.10", features = ["cblas"] }
# Python bindings
pyo3 = { version = "0.28", features = ["extension-module"] }
numpy = "0.28"
# AI / ML
candle-core = "0.9.2"
candle-datasets = "0.9.2"
candle-nn = "0.9.2"
polars = { version = "0.43.1", features = ["lazy"] }
# GPU
cubecl = { version = "0.9.0", default-features = false }
cubecl-cuda = "0.9.0"
cubecl-wgpu = "0.9.0"
cudarc = { version = "0.19.2", features = ["cuda-12080", "cuda-version-from-build-system"] }
gpu-fft = "1.1.1"
metal = "0.33.0"
# Allocators / profiling
mimalloc = "0.1.48"
tikv-jemallocator = "0.6.1"
hotpath = "0.14"
# Yahoo finance
time = { version = "0.3.36", features = ["formatting", "parsing"] }
yahoo_finance_api = "2.3.0"
tokio-test = "0.4.4"
# Dev
romu = "0.8.0"
criterion = { version = "0.8", features = ["html_reports"] }
[package]
name = "stochastic-rs"
version.workspace = true
edition = "2024"
license = "MIT"
description = "A Rust library for quant finance and simulating stochastic processes."
homepage = "https://github.com/dancixx/stochastic-rs"
documentation = "https://docs.rs/stochastic-rs/latest/stochastic_rs/"
repository = "https://github.com/dancixx/stochastic-rs"
readme = "README.md"
keywords = ["stochastic", "quant", "finance", "simulation", "statistics"]
exclude = [ "**/*.tar.gz", "data/**", "trainsets/**", "src/ai/volatility/*TrainSet.txt.gz", ]
[dependencies]
stochastic-rs-core = { workspace = true }
stochastic-rs-distributions = { workspace = true }
stochastic-rs-stochastic = { workspace = true }
stochastic-rs-copulas = { workspace = true }
stochastic-rs-stats = { workspace = true }
stochastic-rs-quant = { workspace = true }
stochastic-rs-viz = { workspace = true }
stochastic-rs-ai = { workspace = true, optional = true }
anyhow = { workspace = true }
argmin = { workspace = true }
argmin-math = { workspace = true, features = ["ndarray_latest-nolinalg", "vec"] }
candle-core = { workspace = true, optional = true }
candle-datasets = { workspace = true, optional = true }
candle-nn = { workspace = true, optional = true }
chrono = { workspace = true }
cubecl = { workspace = true, optional = true, default-features = false }
cubecl-cuda = { workspace = true, optional = true }
cubecl-wgpu = { workspace = true, optional = true }
cudarc = { workspace = true, optional = true, features = [ "cuda-12080", "cuda-version-from-build-system", ] }
either = { workspace = true }
flate2 = { workspace = true }
gpu-fft = { workspace = true, optional = true }
gauss-quad = { workspace = true }
implied-vol = { workspace = true }
kendalls = { workspace = true }
levenberg-marquardt = { workspace = true }
linreg = { workspace = true }
openblas-src = { workspace = true, features = ["cblas"], optional = true }
metal = { workspace = true, optional = true }
mimalloc = { workspace = true, optional = true }
nalgebra = { workspace = true }
ndarray = { workspace = true, features = [ "rayon", "matrixmultiply-threading", ] }
ndarray-linalg = { workspace = true, optional = true }
ndarray-npy = { workspace = true }
ndarray-rand = { workspace = true }
ndarray-stats = { workspace = true }
ndrustfft = { workspace = true }
num-complex = { workspace = true, features = ["rand"] }
num-traits = { workspace = true }
numpy = { workspace = true, optional = true }
pyo3 = { workspace = true, features = ["extension-module"], optional = true }
ordered-float = { workspace = true }
owens-t = { workspace = true }
plotly = { workspace = true, features = ["plotly_ndarray"] }
polars = { workspace = true, features = ["lazy"], optional = true }
quadrature = { workspace = true }
rand = { workspace = true }
rand_distr = { workspace = true }
rayon = { workspace = true }
roots = { workspace = true }
sci-rs = { workspace = true }
scilib = { workspace = true }
slsqp = { workspace = true }
tikv-jemallocator = { workspace = true, optional = true }
time = { workspace = true, features = [ "formatting", "parsing", ], optional = true }
tokio-test = { workspace = true, optional = true }
wide = { workspace = true }
hotpath = { workspace = true, optional = true }
yahoo_finance_api = { workspace = true, optional = true }
parking_lot = { workspace = true }
[dev-dependencies]
criterion = { workspace = true, features = ["html_reports"] }
rand = { workspace = true }
rand_distr = { workspace = true }
romu = { workspace = true }
[[bench]]
name = "distributions"
harness = false
[[bench]]
name = "fgn_fbm"
harness = false
[[bench]]
name = "rl_rough"
harness = false
[[bench]]
name = "process_generation"
harness = false
[[bench]]
name = "gn_batching"
harness = false
[[bench]]
name = "dist_multicore"
harness = false
[[bench]]
name = "fgn_gpu"
harness = false
required-features = ["gpu"]
[[bench]]
name = "fgn_cuda_native"
harness = false
required-features = ["cuda-native"]
[[bench]]
name = "fgn_all_backends"
harness = false
required-features = ["gpu-wgpu", "metal", "accelerate"]
[[bench]]
name = "fgn_accelerate"
harness = false
required-features = ["accelerate"]
[[bench]]
name = "fgn_metal"
harness = false
required-features = ["metal"]
[[bench]]
name = "poisson_process"
harness = false
[[bench]]
name = "mle"
harness = false
[[bench]]
name = "hurst"
harness = false
[[bench]]
name = "calendar"
harness = false
[[bench]]
name = "cashflows"
harness = false
[[bench]]
name = "market"
harness = false
[[bench]]
name = "instruments"
harness = false
[[bench]]
name = "credit"
harness = false
[[bench]]
name = "risk"
harness = false
[[bench]]
name = "realized"
harness = false
[[bench]]
name = "microstructure"
harness = false
[[bench]]
name = "factors"
harness = false
required-features = ["openblas"]
[[bench]]
name = "econometrics"
harness = false
[[bench]]
name = "filtering"
harness = false
[[bench]]
name = "lattice"
harness = false
[[bench]]
name = "option"
harness = false
[[bench]]
name = "slv"
harness = false
[[bench]]
name = "hotpath_profile"
harness = false
required-features = ["hotpath"]
[[bench]]
name = "dual_stream_compare"
harness = false
required-features = ["dual-stream-rng"]
[features]
ai = ["dep:stochastic-rs-ai", "stochastic-rs-ai/quant"]
cuda-native = ["dep:cudarc", "cudarc/cufft", "stochastic-rs-stochastic/cuda-native"]
default = []
# Experimental: opt in to the dual-stream RNG (`SimdRngDual` /
# `SimdNormalDual`). ~5–11% speedup on Ziggurat-based Normal/Exp bulk
# fills on Apple Silicon; deterministic output differs from the
# single-stream `SimdRng`. See `stochastic-rs-core` feature doc.
dual-stream-rng = [
"stochastic-rs-core/dual-stream-rng",
"stochastic-rs-distributions/dual-stream-rng",
]
openblas = [
"dep:ndarray-linalg",
"dep:openblas-src",
"ndarray-linalg/openblas-system",
"stochastic-rs-copulas/openblas",
"stochastic-rs-quant/openblas",
"stochastic-rs-stats/openblas",
"stochastic-rs-stochastic/openblas",
]
# Vendored / static OpenBLAS — used by the Windows wheel CI job because the
# MSVC toolchain cannot reliably link the prebuilt MinGW `.lib`. Unix targets
# stay on `openblas` (system-link) for faster developer builds.
openblas-static = [
"dep:ndarray-linalg",
"dep:openblas-src",
"ndarray-linalg/openblas-static",
"openblas-src/static",
"stochastic-rs-copulas/openblas-static",
"stochastic-rs-quant/openblas-static",
"stochastic-rs-stats/openblas-static",
"stochastic-rs-stochastic/openblas-static",
]
accelerate = ["stochastic-rs-stochastic/accelerate"]
gpu = ["dep:cubecl", "dep:gpu-fft", "stochastic-rs-stochastic/gpu"]
metal = ["dep:metal", "stochastic-rs-stochastic/metal"]
gpu-cuda = ["gpu", "dep:cubecl-cuda", "stochastic-rs-stochastic/gpu-cuda"]
gpu-wgpu = ["gpu", "dep:cubecl-wgpu", "stochastic-rs-stochastic/gpu-wgpu"]
jemalloc = ["dep:tikv-jemallocator"]
# Python bindings live in `stochastic-rs-py` (separate cdylib). Enabling
# `python` here just turns on the upstream feature flags so the umbrella
# build is consistent with the cdylib build. The actual Python module
# (`stochastic_rs`) is produced by `cargo build -p stochastic-rs-py` or
# via `maturin develop` from the `stochastic-rs-py` directory.
python = [
"dep:pyo3",
"dep:numpy",
"stochastic-rs-distributions/python",
"stochastic-rs-stochastic/python",
"stochastic-rs-copulas/python",
"stochastic-rs-stats/python",
"stochastic-rs-quant/python",
]
mimalloc = ["dep:mimalloc"]
yahoo = [
"dep:time",
"dep:yahoo_finance_api",
"dep:polars",
"dep:tokio-test",
"stochastic-rs-quant/yahoo",
]
hotpath = ["dep:hotpath", "hotpath/hotpath"]
hotpath-alloc = ["hotpath", "hotpath/hotpath-alloc"]
[lib]
name = "stochastic_rs"
crate-type = ["lib"]
path = "src/lib.rs"
doctest = false
[profile.release]
debug = false
codegen-units = 1
lto = true
[package.metadata.docs.rs]
# Avoid `all-features = true`: it pulls in native GPU SDKs (cubecl-cuda,
# cudarc, metal), system OpenBLAS, pyo3 link, and yahoo's tokio-test
# dev-only feature, none of which build cleanly on docs.rs.
features = ["openblas", "ai", "yahoo"]
rustdoc-args = ["--html-in-header", "docs/katex-header.html"]