quantgirluk / aleatory Goto Github PK
View Code? Open in Web Editor NEW๐ฆ Python library for Stochastic Processes Simulation and Visualisation
License: MIT License
๐ฆ Python library for Stochastic Processes Simulation and Visualisation
License: MIT License
Hi there -
Very impressive package and thank you for making public!
I had an enhancement question.
Was curious if this package is planned to support multivariate processes? If I say have X commodities following various processes, with correlated random shocks.
Say two commodities, define one as GBM and the other as UO, with 70% correlation in their random draw direction. Is something like this currently feasible or something in the future plans?
My background in stochastic processes is in R, and can only point to MASS::mvrnorm as an example of the correlated draws.
Cheers!
Hi, I liked your package, thank you!
I believe there is a mistake in the Vasicek function
def g(x, _): return self.sigma
It should be
def g(x, _): return self.sigma * x
right?
Modelling hashtag#short_term_interest_rates sometimes requires the hashtag#stochastic_model to be defined as the solution to a stochastic differential equation, so it is necessary to perform a time discretisation and then simulate the random component. Attached is an algorithm for simulating the path of a process called CKLS, which is a generalisation of several well-known processes, such as Brownian motion, the Ornstein-Uhlenbeck process, CIR, and so on.
[1] CHAN, K. C., KAROLYI, G. A., LONGSTAFF, F. A., & SANDERS, A. B. (1992).
An Empirical Comparison of Alternative Models of the Short-Term Interest Rate. The Journal of Finance, 47(3), 1209โ1227.
Add simulation for fBM.
Note that there are several implementations.
Very nice package! I'm learning stochastic calculus and this is a really cool tool!
I found a small bug:
The paths plotted by SPExplicit.draw()
are colored to match the histogram bin that their final point falls into.
If we plot N=3
or fewer paths, then we set n_bins = int(np.sqrt(N)) <= 1
, and then this logic which helps set the path colors:
bin_centers = 0.5 * (bins[:-1] + bins[1:])
col = bin_centers - min(bin_centers) # scale values to interval [0,1]
col /= max(col)
results in a divide by zero
/Users/alexrubin/code/aleatory/aleatory/utils/utils.py:76: RuntimeWarning: invalid value encountered in divide
col /= max(col)
because col == [0.]
.
It seems like the 3 lines of logic above could be replaced by col = np.linspace(0, 1, n_bins, endpoint=True)
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.