Skip to content

Commit

Permalink
Merge pull request #28 from wgurecky/scipy_mle_fix
Browse files Browse the repository at this point in the history
Fix for MLE copula fit
  • Loading branch information
wgurecky authored Jul 18, 2020
2 parents ff9fd8f + c6a129c commit a900763
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion starvine/bvcopula/copula/copula_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def fitMLE(self, u, v, *theta0, **kwargs):
x0=params0,
bounds=kwargs.pop("bounds", self.thetaBounds),
tol=kwargs.pop("tol", 1e-8),
method=kwargs.pop("method", 'SLSQP'))
method=kwargs.pop("method", 'trust-constr'))
if not res.success:
# Fallback
if "frank" in self.name:
Expand Down
6 changes: 3 additions & 3 deletions starvine/bvcopula/copula/mvtdstpack/mvtdstpack.f
Original file line number Diff line number Diff line change
Expand Up @@ -1329,7 +1329,7 @@ SUBROUTINE MVKBRV( NDIM, MINVLS, MAXVLS, NF, FUNSUB,
* estimated absolute accuracy ABSERR.
************************************************************************
EXTERNAL FUNSUB
DOUBLE PRECISION ABSEPS, RELEPS, FINEST(*), ABSERR, ONE
DOUBLE PRECISION ABSEPS, RELEPS, FINEST(*), ABSERR(1), ONE
INTEGER NDIM, NF, MINVLS, MAXVLS, INFORM, NP, PLIM, KLIM,
& NLIM, FLIM, SAMPLS, I, K, INTVLS, MINSMP, KMX
PARAMETER ( PLIM = 28, NLIM = 1000, KLIM = 100, FLIM = 5000 )
Expand Down Expand Up @@ -1387,8 +1387,8 @@ SUBROUTINE MVKBRV( NDIM, MINVLS, MAXVLS, NF, FUNSUB,
IF ( VARSQR(K) .GT. 0 ) VAREST(K) = ( 1 + VARPRD )/VARSQR(K)
IF ( ABS(FINEST(K)) .GT. ABS(FINEST(KMX)) ) KMX = K
END DO
ABSERR = 7*SQRT( VARSQR(KMX)/( 1 + VARPRD ) )/2
IF ( ABSERR .GT. MAX( ABSEPS, ABS(FINEST(KMX))*RELEPS ) ) THEN
ABSERR(1) = 7*SQRT( VARSQR(KMX)/( 1 + VARPRD ) )/2
IF ( ABSERR(1) .GT. MAX( ABSEPS, ABS(FINEST(KMX))*RELEPS ) ) THEN
IF ( NP .LT. PLIM ) THEN
NP = NP + 1
ELSE
Expand Down

0 comments on commit a900763

Please sign in to comment.