danielbok / muarch Goto Github PK
View Code? Open in Web Editor NEWMultiple Univariate AR-GARCH Modelling with Copula marginals for simulation
License: MIT License
Multiple Univariate AR-GARCH Modelling with Copula marginals for simulation
License: MIT License
Hey,
when i try to install muarch in my venv, i get the error "Failed building wheel for muarch". I have already tried all the tricks to solve the problem (installing wheel, etc.) without success. However, globally it is possible to install muarch. Is there a solution for this problem?
Best,
Tim
Hi, thanks for building this package!
I just ran your example notebook and it fails with the error below. If I skip the part where you set the first model distribution to 'skewt' it works.
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-8-8816a759b7b9> in <module>
2 trials = 100
3
----> 4 models.simulate_mc(horizon, trials, custom_dist=cop.random)
~/anaconda3/lib/python3.7/site-packages/muarch/muarch.py in simulate_mc(self, nobs, reps, burn, initial_value, x, initial_value_vol, custom_dist, n_jobs)
417 sims = np.zeros((nobs, reps, self.__n))
418 for i, func in enumerate(functions):
--> 419 sims[:, :, i] = func()
420
421 return sims
~/anaconda3/lib/python3.7/site-packages/muarch/uarch.py in simulate_mc(self, nobs, reps, burn, initial_value, x, initial_value_vol, params, custom_dist)
487 params = self.params
488
--> 489 return self._model.simulate_mc(params, nobs, reps, burn, initial_value, x, initial_value_vol) / self._scale
490
491 def summary(self, short=False, dp=4) -> Union[pd.Series, Summary]:
~/anaconda3/lib/python3.7/site-packages/muarch/mean/simulators.py in decorator(model, params, nobs, reps, burn, initial_value, x, initial_value_vol)
201 vol_params = params[mc:mc + vc]
202 simulator = model.distribution.simulate(dist_params)
--> 203 errors = model.volatility.simulate_mc(vol_params, nobs + burn, reps, simulator, burn, initial_value_vol)
204
205 max_lag = np.max(lags) if lags.size else 0
~/anaconda3/lib/python3.7/site-packages/muarch/volatility/simulators.py in decorator(model, parameters, nobs, reps, rng, burn, initial_value)
48 def decorator(model, parameters: np.ndarray, nobs: int, reps: int, rng: RNG, burn=500, initial_value=None):
49 p, o, q, power = model.p, model.o, model.q, model.power
---> 50 errors = rng(nobs + burn, reps)
51
52 if initial_value is None:
~/anaconda3/lib/python3.7/site-packages/muarch/distributions/_base.py in decorator(self, size, reps)
15 raise ValueError('`reps` must be an integer greater than 0')
16
---> 17 value = _simulate(self, size, reps)
18
19 if isinstance(value, (int, float)):
~/anaconda3/lib/python3.7/site-packages/muarch/distributions/skew_student.py in _simulator(self, size, reps)
22 else:
23 self.check_dist_size(size)
---> 24 ppf = self.ppf(self.custom_dist[:size], nu)
25 self.custom_dist = None # reset simulator
26
~/anaconda3/lib/python3.7/site-packages/muarch/distributions/skew_student.py in ppf(self, pits, parameters)
28
29 def ppf(self, pits, parameters=None):
---> 30 self._check_constraints(parameters)
31
32 scalar = np.isscalar(pits)
~/anaconda3/lib/python3.7/site-packages/arch/univariate/distribution.py in _check_constraints(self, parameters)
63 nparams = 0
64 if nparams != len(bounds):
---> 65 raise ValueError("parameters must have {0} elements".format(len(bounds)))
66 if len(bounds) == 0:
67 return empty(0)
ValueError: parameters must have 2 elements
Hi,
I am using your package to forecast and simulate returns for 5 index using a Copula too. However, when using the function simulate_mc and compute the cumulative returns are quite a lot of time <-1 which is not possible.
I am using quarterly data, with not a lot of observation (79), I tried using different index with daily observation and it appears that it is working so i am wondering where could be the problem...
Kind regards,
Sebastien
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.