Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clayton and Gumbel Copula Error #324

Open
dorcasgicuku opened this issue Jun 7, 2022 · 0 comments
Open

Clayton and Gumbel Copula Error #324

dorcasgicuku opened this issue Jun 7, 2022 · 0 comments
Labels
bug There is an error in the code that needs to be fixed under discussion Issue is currently being discussed

Comments

@dorcasgicuku
Copy link

Working with Gumbel and Clayton Copula with weather dataset produces the following error for some set of variables.

Clayton Error
ValueError Traceback (most recent call last)
in
14 clayton_parameters = clayton_copula_model.to_dict()
15 print("The theta value of", pairedData, "is",clayton_parameters['theta'])
---> 16 clayton_copula_function()

in clayton_copula_function()
11 clayton_data = clayton_df.to_numpy()
12 #Fit the model to paired data obtained from permutations the dataset
---> 13 clayton_copula_model.fit(clayton_data)
14 clayton_parameters = clayton_copula_model.to_dict()
15 print("The theta value of", pairedData, "is",clayton_parameters['theta'])

~\Anaconda3\envs\copulas_env\lib\site-packages\copulas\bivariate\base.py in fit(self, X)
182 raise ValueError("Constant column.")
183 raise ValueError("Unable to compute tau.")
--> 184 self._compute_theta()
185
186 def to_dict(self):

~\Anaconda3\envs\copulas_env\lib\site-packages\copulas\bivariate\base.py in _compute_theta(self)
163 """Compute theta, validate it and assign it to self."""
164 self.theta = self.compute_theta()
--> 165 self.check_theta()
166
167 def fit(self, X):

~\Anaconda3\envs\copulas_env\lib\site-packages\copulas\bivariate\base.py in check_theta(self)
126 if (not lower <= self.theta <= upper) or (self.theta in self.invalid_thetas):
127 message = 'The computed theta value {} is out of limits for the given {} copula.'
--> 128 raise ValueError(message.format(self.theta, self.copula_type.name))
129
130 def check_fit(self):

ValueError: The computed theta value -0.6795841166551324 is out of limits for the given CLAYTON copula

Gumbel Copula

ValueError Traceback (most recent call last)
in
14 gumbel_parameters = gumbel_copula_model.to_dict()
15 print(gumbel_parameters['theta'])
---> 16 gumbel_copula_function()
17 # gumbel_copula_model.fit(arch_data)
18 # gumbel_parameters = gumbel_copula_model.to_dict()

in gumbel_copula_function()
11 gumbel_data = gumbel_df.to_numpy()
12 #Fit the model to paired data obtained from permutations the dataset
---> 13 gumbel_copula_model.fit(gumbel_data)
14 gumbel_parameters = gumbel_copula_model.to_dict()
15 print(gumbel_parameters['theta'])

~\Anaconda3\envs\copulas_env\lib\site-packages\copulas\bivariate\base.py in fit(self, X)
182 raise ValueError("Constant column.")
183 raise ValueError("Unable to compute tau.")
--> 184 self._compute_theta()
185
186 def to_dict(self):

~\Anaconda3\envs\copulas_env\lib\site-packages\copulas\bivariate\base.py in _compute_theta(self)
163 """Compute theta, validate it and assign it to self."""
164 self.theta = self.compute_theta()
--> 165 self.check_theta()
166
167 def fit(self, X):

~\Anaconda3\envs\copulas_env\lib\site-packages\copulas\bivariate\base.py in check_theta(self)
126 if (not lower <= self.theta <= upper) or (self.theta in self.invalid_thetas):
127 message = 'The computed theta value {} is out of limits for the given {} copula.'
--> 128 raise ValueError(message.format(self.theta, self.copula_type.name))
129
130 def check_fit(self):

ValueError: The computed theta value 0.6602079416724338 is out of limits for the given GUMBEL copula.

@dorcasgicuku dorcasgicuku added bug There is an error in the code that needs to be fixed under discussion Issue is currently being discussed labels Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug There is an error in the code that needs to be fixed under discussion Issue is currently being discussed
Projects
None yet
Development

No branches or pull requests

1 participant