Bivariate copula#3
Conversation
- Fixed hardcoded 200 parameter bounds to use Frank-specific 20 bounds - Enhanced Gram matrix regularization with adaptive conditioning - Added weight validation safeguards for numerical stability - Removed scaler-related NaN sources through proper bounds handling - Frank copula now produces clean coefficients without NaN values
|
Changes in online_mvdistreg |
- Removed obsolete test files and data - Frank copula working with stable coefficients - All NaN issues resolved with proper parameter bounds
e37cc87 to
adac321
Compare
- Replace slow list comprehensions with vectorized st.t.ppf calls - Vectorize st.t.pdf calculations for major speedup - Apply optimizations to likelihood and derivative functions - Achieve 4.1x performance improvement (90s -> 22s) - Maintain 100% mathematical accuracy with same analytical formulas
- Change rho initialization from direct tau to sin(tau * pi/2) transformation - Change nu default from 10 to 8 to match R VineCopula MLE method - Improves compatibility with R BiCopEst initialization values - Addresses numerical stability and convergence consistency
- Integrated R VineCopula compatibility improvements in bicop_studentt.py - Applied performance optimizations from remote branch - Resolved conflicts while preserving improved initial_values method
- Removed leftover merge conflict marker that was causing syntax errors - File now compiles cleanly without red error indicators
…into bivariate_copula
… compatible implementation
… DF iteration work
…ion from chrischu12
…ion, and performance improvements
… into bivariate_copula
|
|
||
| # Calculate the gamma ratio using stable division | ||
| gamma_ratio = nu/2 | ||
| gamma_ratio = stable_gamma_division((nu + 2.0) / 2.0, nu / 2.0) |
There was a problem hiding this comment.
The change for nu has been corrected
| except: | ||
| continue | ||
|
|
||
| def negative_log_likelihood(params): |
There was a problem hiding this comment.
you define this in many functions at the same time, please define only once in the t copula
| def get_regularization_size(self, dim: int) -> int: | ||
| return dim | ||
|
|
||
| def r_style_nu_optimization(self, y, initial_rho=None): |
There was a problem hiding this comment.
This was a function to test the initial values in R, it is of no use now, I have already deleted it.
| out = prediction | ||
| return out | ||
|
|
||
| def _df_iteration(self, y, rho_values): |
There was a problem hiding this comment.
this must go in the copula function no?
There was a problem hiding this comment.
Yes it should go into the copula. I already moved into bicop_studentt.py
| rho_updated = theta[a][0].flatten() | ||
|
|
||
| # Optimize nu using DF iteration | ||
| optimal_nu = self._df_iteration(y, rho_updated) |
There was a problem hiding this comment.
but this means you also reoptimize even when you estimate nu using covariates, no?
There was a problem hiding this comment.
Yes, now we also re-optimize nu when covariates are used, so the nu update is refreshed with new data in this setup
f958ffd to
b5207eb
Compare
Make a coment in the second derivative function.