Code Monkey home page Code Monkey logo

muarch's People

Contributors

danielbok avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

muarch's Issues

"ERROR: Failed building wheel for muarch" in venv

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

Skew T example doesn't work

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

mc_simulation

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.