Message Boards Message Boards

0
|
7460 Views
|
3 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Get standard errors for MLE of Subbotin Distribution?

Hello everyone! :)

I tried to estimate the standard errors of fitted Subbotin (exponential power) distribution parameters which have been calculated with FindDistributionParameters. Therefore I used the bootstrap method:

dist = ExponentialPowerDistribution[a,b,c];data = eurjpylogret;
(*Fit distribution parameters*)Parametersfit = FindDistributionParameters[data, dist]
(*Bootstrapping*)Bootstrapping := {a, b,c} /. FindDistributionParameters[RandomChoice[data, Length@data], dist];
BootEstimates = ParallelTable[Bootstrapping, {10000}];
(*Bootstrapped SD estimation*) BootStd = StandardDeviation /@Transpose[BootEstimates]

Unfortunately I always get the error message when it comes to the standard errors:

NMaximize::cvmit : Failed to converge to the requested accuracy or precision within 100 iterations.
General::stop :  Further output of NMaximize::cvmit will be suppressed during this calculation. 

And so on (it doesn't run out - I don't get a result).

The data I like to fit a Subbotin to are daily log-returns of the EUR/JPY exchange rate from 2006 to 2016. They look as follows (not complete - example):

{0.00312643, 0.000780082, -0.00750093, -0.000523903, 0.00137466, 0.00398238, 0.0055229, 0.00394478, 0.00257832, -0.00193311, 0.,
-0.00452519, 0.00735914, 0.0033389, -0.000962001, 0.00262728, -0.00102446, 0.00326181, 0.00204121, 0.00527504, 0., -0.010514,
-0.0100432, -0.000841506, 0.00542497, -0.00174053, 0.00752052, -0.00590882, 0.0048837, 0.00172927, -0.00333312, 0.00665517,
0.00216616, 0.00254243, 0.00310569, 0.0002531, -0.00749353, -0.00108422, 0.00629753, 0.00183725, -0.00456767, -0.00267414,
0.00496058, -0.0113565, -0.0018625, 0.00755687, 0.00597928, 0.00240704, -0.000759494, 0.000316526, 0.00353826, -0.00486834,
-0.00961638, 0.00472422, 0.00634882, 0.00567968, 0.000566198, 0.00219884, -0.00408741, -0.00644796, -0.00783119, -0.00660534,
-0.00976311, -0.0195519, 0.0115936, 0.000785597, 0.00788714, 0.00168667, 0.00103654, -0.00194439, -0.00311891, 0.00926322,
0.00341154, 0.00352802, -0.000128074, 0.0031331, 0.00401389, -0.00395006, 0.00255021, 0.00546102, -0.00973631, 0.00236324,
0.00362977, 0.000190676, 0.00747123, 0.00107178, 0.00188857, 0.00658206, -0.000312451, 0.00386751, -0.000435906, 0.00874397,
-0.000926584, -0.00644804, -0.00398879, 0.00820951, -0.00335029, 0.00297859, 0.00346385, 0.00191234, 0.00307674, 0.000368573,
0.00282122, 0.00116297, -0.00195946, 0.000980212, -0.00626538, 0.00036964, 0.00313644, -0.0086335, 0.0098608, 0.000122647,
0.00342802, 0.000794111, -0.0047128, 0.00196127, 0.000918021, 0.00232189, -0.00397493, 0.00183655, 0.00128358, 0.00317131,
-0.00592386, 0.00183587, 0.00152732, 0.00323023, 0.000486677, -0.00457192, -0.00146744, -0.00632234, 0.000923219, 0.0000615176,
-0.000246093, 0.00637882, 0.00524423, 0.00630534, 0., 0.00253516, -0.00229344, 0.00752449, -0.00324364, -0.00259044, -0.00659669,
0.00557071, 0.00614016, 0.000180023, -0.000180023, 0.00143928, 0.00137737, 0.00280874, 0.00333632, -0.00160719, -0.00280388,
0.0059563, 0.00172071, -0.00499228, 0.00136941, 0.00136754, 0.00213675, -0.00118652, -0.00523748, -0.00215054, -0.010037,
-0.00624112}

Can someone please help me? I tried to solve and asked for help in the stackoverflow forum already, however, noone could help me to solve it there.

Thank you in advance!

Best regards Alex

3 Replies

Good evening Neil,

thank you very much! You are such a great help! :)

I just had to change the ParameterEstimator to "MethodOfMoments" and it worked fine for the whole dataset.

In the end I used the following code:

Bootstrapping := {\[Kappa], \[Mu], \[Sigma]} /. 
   FindDistributionParameters[RandomChoice[data, Length@data], dist, 
    AccuracyGoal -> 20, PrecisionGoal -> 20, 
    ParameterEstimator -> "MethodOfMoments"];

Thank you very much again! :)

Best regards Alex

Alex,

This seems to significantly reduce or eliminate the frequency of your problem (I got no failures in 1000):

Bootstrapping := {a, b, c} /. 
   FindDistributionParameters[RandomChoice[data, Length@data], dist, 
    AccuracyGoal -> 4, PrecisionGoal -> 3];

Experiment with other numbers. You can also increase the MachinePrecision to help but it will slow things down. Mathematica in default tries for extreme precision. It may be beyond what you want/need and can sometimes cause convergence issues.

I think you can safely combine reducing the precision a bit with throwing out the handful that might possibly fail out of 10,000.

Regards

POSTED BY: Neil Singer

Alex,

It seems that your randomly sampled data sometimes is skewed in a way that makes the optimization in FindDistributionParameters fail to converge. It does give an answer although I am not sure how valid the answer is -- you can get examples of this by replacing your ParallelTable with Table and use a small number of samples (say 100) -- when the error occurs you can click on the "..." next to NMaximize and do showstacktrace and copy the actual expression that failed. With this you can figure out what is causing the problem (from the few I examined they seemed skewed to one side)

I would also contact Wolfram to see if the iteration limit can be increased. Another option is to throw out resampled data that failed to converge (I am not sure what implications that has on the statistics??.)

Lastly, I think you have an error in the Transpose. -- I believe that StandardDeviation expects the data the way that you have it (in columns) and not Transposed.

I hope this helps.

Regards

POSTED BY: Neil Singer
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract