Robust estimation of self-exciting...: Index exceeds matrix dimensions. running example()


(Stephen Crowley) #1

I’m getting a problem running the example from https://codeocean.com/2017/05/02/robust-estimation-of-self-exciting-generalized-linear-models/code which uses the cvx library … does anyone have any ideas what the problem might be?

thanks in advance,
Stephen

In cvxprob (line 28)
In cvx_begin (line 41)
In Estimate_pp (line 18)
In example (line 4)
Index exceeds matrix dimensions.

Error in cvx/cvx_readlevel (line 6)
y = max( sparse( r, c, cvx___.readonly( r ), s(1), s(2) ), [], 1 );

Error in cvxprob/newcnstr (line 94)
tx = cvx_readlevel( x );

Error in <= (line 21)
b = newcnstr( evalin( ‘caller’, ‘cvx_problem’, ‘[]’ ), x, y, ‘<=’ );

Error in cvx/log (line 74)
exp( yt ) <= xt; %#ok

Error in Estimate_pp (line 21)
minimize( (-(1-regressors)’(1-mu_sp-Atheta_sp)-regressors’log(mu_sp+Atheta_sp))/n + lambda*norm(theta_sp,1))

Error in example (line 4)
sys_est = Estimate_pp(sys);


(Mark L. Stone) #2

I ran this successfully for a few different random instantiations ( sys = gen_synthetic_data( p, s, n ); invocations) using MATLAB R2014A WIN64:

CVX’s successive approximation method under CVX 2.1 Build 1116 using sedumi and sdpt3;
CVX’s successive approximation method under CVX 3.0beta Build 1177 using sedumi and sdpt3;
Native exponential cone support under CVX 3.0beta Build 1177 using ecos and scs.
and got essentially the same solution for all solvers on a given random instantiation.

Try removing cvx_quiet(true). Do you see any solver output? Do you ever get to I`teration 1 of OMP completed`` ?

Have you successfully run anything in CVX? What is the output of CVX_version?


(Michael C. Grant) #3

I would suggest reaching out to the developers of the original work.


(Mark L. Stone) #4

Given that I successfully executed the code using 2 different version of CVX and several solvers, including with and without CVX"s successive approximation method, I doubt that contacting the developers of the original work would be fruitful. Instead, I suspect a problem with the OP’s configuration or installation.


(Stephen Crowley) #5

I’m not sure what it was, but I restarted matlab and made sure the path was setup, addpath(genpath(’/code’)) and ran the example function from that URL and it worked beautifully this time. I appreciate y’alls help


(Michael C. Grant) #6

Good point, Mark! Stephen, I’m glad you got it working.