Dear jpfeifer,

Thanks for your answer. Let me add some info regarding my question. I am running this model for two countries, so I have created two files: ven_calibration.mat and arg_calibration.mat. In each file, I have included a date indicating when a structural change was detected, what should I do to run a Bayesian analysis for the whole sample, the sample previous to the structural break, and after?

I have wrote this code:

```
% Get the time cut date
time_cut = dates(calib.date_cut);
initial_date = dataset_.dates(1);
time_cut_index = find(dataset_.dates == time_cut);
```

Estimation for the whole sample

```
@#if VENEZUELA == 1
estimation(order=1,
mode_compute=6,
datafile='DATA\ven_bayesian_estimation_data.csv',
mh_replic=20000,
mh_nblocks=5,
mh_jscale=0.5,
bayesian_irf,
irf=20,
conf_sig=0.95,
mh_drop=0.25,
consider_all_endogenous);
calib_smoother(datafile='DATA\ven_bayesian_estimation_data.csv');
@#endif
@#if ARGENTINA == 1
estimation(order=1,
mode_compute=6,
datafile='DATA\arg_bayesian_estimation_data.csv',
mh_replic=20000, mh_nblocks=5,
mh_jscale=0.5,
bayesian_irf,
irf=20,
conf_sig=0.95,
mh_drop=0.25,
consider_all_endogenous);
calib_smoother(datafile='DATA\arg_bayesian_estimation_data.csv');
@#endif
```

Estimation for the sub-sample previous to the structural break

```
% Bayesian Estimation For the calm period
@#if VENEZUELA == 1
estimation(order=1,
mode_compute=6,
datafile='DATA\ven_bayesian_estimation_data.csv',
mh_replic=20000,
mh_nblocks=5,
mh_jscale=0.5,
bayesian_irf,
irf=20,
conf_sig=0.95,
mh_drop=0.25,
nobs= time_cut_index,
consider_all_endogenous);
@#endif
@#if ARGENTINA == 1
estimation(order=1,
mode_compute=6,
datafile='DATA\arg_bayesian_estimation_data.csv',
mh_replic=20000,
mh_nblocks=5,
mh_jscale=0.5,
bayesian_irf,
irf=20,
conf_sig=0.95,
mh_drop=0.25,
nobs= time_cut_index,
consider_all_endogenous);
@#endif
```

Estimation for the sub-sample after the structural break:

```
@#if VENEZUELA == 1
estimation(order=1,
mode_compute=6,
datafile='DATA\ven_bayesian_estimation_data.csv',
mh_replic=20000,
mh_nblocks=5,
mh_jscale=0.5,
bayesian_irf,
irf=20,
conf_sig=0.95,
mh_drop=0.25,
first_obs= time_cut_index,
consider_all_endogenous);
@#endif
@#if ARGENTINA == 1
estimation(order=1,
mode_compute=6,
datafile='DATA\arg_bayesian_estimation_data.csv',
mh_replic=20000, mh_nblocks=5,
mh_jscale=0.5,
bayesian_irf,
irf=20,
conf_sig=0.95,
mh_drop=0.25,
first_obs= time_cut_index,
consider_all_endogenous);
@#endif
```

Look That I have using the time_cut_index (which tells me the position where the break happens In the times series) in the first sub-sample as the number of obs to use and in the second sub-sample as the first observation to use. The problem is that I am having problems running the mod file. I have tried defining tiime_cut_index in the macro like:

```
@# define time_cut_index = find(dataset_.dates == time_cut);
```

and then adding it like:

```
first_obs= @{time_cut_index}
nobs= @{time_cut_index}
```

But I have not succeed. Hope you can help me.