Skip to content

Commit

Permalink
fixing bug in copula rvs
Browse files Browse the repository at this point in the history
  • Loading branch information
tfm000 committed Dec 4, 2023
1 parent 52ed7ed commit df967f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sklarpy/copulas/_prefit_dists.py
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,8 @@ def copula_rvs(self, size: int, copula_params: Union[Params, tuple],
"""
max_num_loops: int = 100
num_loops: int = 0
d: int = self._mv_object._get_dim(copula_params)
d: int = self._mv_object._get_dim(
self._mv_object._get_params(copula_params))
valid_copula_rvs: deque = deque()
while size > 0:
# generating random variables from multivariate distribution
Expand All @@ -820,7 +821,6 @@ def copula_rvs(self, size: int, copula_params: Union[Params, tuple],
# repeating until sample size reached
size -= copula_rvs.shape[0]
num_loops += 1

if num_loops > max_num_loops:
raise ArithmeticError(f"Unable to generate valid copula rvs. "
f"number of retries reached "
Expand Down

0 comments on commit df967f0

Please sign in to comment.