# Error in MCMC diagnostics: Parallel

**URL:** <https://forum.dynare.org/t/error-in-mcmc-diagnostics-parallel/3142>\
**Category:** Dynare help (legacy posts)\
**Created:** [7 May 2013 08:30 UTC](https://forum.dynare.org/t/error-in-mcmc-diagnostics-parallel/3142 "2013-05-07T08:30:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lombard](https://forum.dynare.org/letter_avatar_proxy/v4/letter/l/ecb155/32.png) [@lombard](https://forum.dynare.org/u/lombard)\
**Post date:** [7 May 2013 08:30 UTC](https://forum.dynare.org/t/error-in-mcmc-diagnostics-parallel/3142/1 "2013-05-07T08:30:48Z")

</div>

Hi,

after running MCMC with load\_mh\_file I get the following error

[quote]MH: I’m loading past metropolis-hastings simulations…  
MH: … It’s done. I’ve loaded 1305000 simulations.

ssh @localhost rm -f //random\_walk\_metropolis\_hastings\_core\_output\__.mat: Signal 127  
ssh @localhost rm -f //comp\_status\_random\_walk\_metropolis\_hastings\_core_.mat: Signal 127  
ssh @localhost rm -f //slaveParallel\_break.mat: Signal 127  
MH: Number of mh files : 828 per block.  
MH: Total number of generated files : 4968.  
MH: Total number of iterations : 1310000.  
MH: average acceptation rate per chain :  
0.5585 0.5915 0.5809 0.5951 0.5877 0.5817

MCMC Diagnostics: Univariate convergence diagnostic, Brooks and Gelman (1998):  
ssh @localhost rm -f //McMCDiagnostics\_core\_output\__.mat: Signal 127  
ssh @localhost rm -f //comp\_status\_McMCDiagnostics\_core_.mat: Signal 127  
ssh @localhost rm -f //slaveParallel\_break.mat: Signal 127  
Job number 1 crashed with error:  
Error using load  
Unable to read file ECB\_IPAM/metropolis/ECB\_IPAM\_mh444\_blck1.mat: No such file or directory.

ans =

```
file: '/jobdata/dynare-4.3.3/matlab/McMCDiagnostics_core.m'
name: 'McMCDiagnostics_core'
line: 87

```

ans =

```
file: '/jobdata/dynare-4.3.3/matlab/parallel/fParallel.m'
name: 'fParallel'
line: 73

```

[/quote]

Any idea of what might have gone wrong?

Best

Gianni

---

<div class="post-metadata">

**Author:** ![lombard](https://forum.dynare.org/letter_avatar_proxy/v4/letter/l/ecb155/32.png) [@lombard](https://forum.dynare.org/u/lombard)\
**Post date:** [7 May 2013 13:00 UTC](https://forum.dynare.org/t/error-in-mcmc-diagnostics-parallel/3142/2 "2013-05-07T13:00:32Z")

</div>

The problem is not specific to the parallel execution.

Apparently successive runs of MCMC maintaining the old chains generated some inconsistency in the number of saved  
chains (the 444 was missing).  
The diagnostic file does not check how many files do actually exist and then it crashes when it does not find what expected.

A suggestion for the developers would be to make the diagnostic function use only the chains that actually exist in the folder.

Best

Gianni

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [7 May 2013 20:44 UTC](https://forum.dynare.org/t/error-in-mcmc-diagnostics-parallel/3142/3 "2013-05-07T20:44:31Z")

</div>

Thanks, we will look into it.
