# Divergent transitions & BFMI low in a state-space model

**URL:** <https://discourse.mc-stan.org/t/divergent-transitions-bfmi-low-in-a-state-space-model/1551>\
**Category:** Modeling\
**Created:** [August 13, 2017, 7:28am UTC](https://discourse.mc-stan.org/t/divergent-transitions-bfmi-low-in-a-state-space-model/1551 "2017-08-13T07:28:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ytan](https://avatars.discourse-cdn.com/v4/letter/y/439d5e/32.png) [@ytan](https://discourse.mc-stan.org/u/ytan)\
**Post date:** [August 13, 2017, 7:28am UTC](https://discourse.mc-stan.org/t/divergent-transitions-bfmi-low-in-a-state-space-model/1551/1 "2017-08-13T07:28:00Z")

</div>

I ran the following state space model, but got a warning message. Please find an attached file to reproduce my results.

**stan code**

```
data {
  int P;
  int T;
  int T_pred;
  real<lower=0, upper=10> H[P,T];
}

parameters {
  real mu_H[P,T];
  real<lower=0> s_mu[P];
  real<lower=0> s_H;
}

model {
  for (p in 1:P){
    s_mu[p] ~ student_t(4,0,2); 
  }
  for (t in 3:T)
    for (p in 1:P){
      mu_H[p,t] ~ normal(2 * mu_H[p,t - 1] - mu_H[p,t - 2], s_mu[p]);
      //assuming that s_mu differs across prefectures 
      H[p,t] ~ normal(mu_H[p,t], s_H);
    }
}

generated quantities {
  real mu_all[P,T + T_pred];
  real h_pred[P,T_pred];
  for (t in 1:T)
    for (p in 1:P)
      mu_all[p,t] = mu_H[p,t];
  for (t in 1:T_pred)
    for (p in 1:P){
      mu_all[p,T + t] = normal_rng(2 * mu_all[p,T + t - 1]
                      - mu_all[p,T + t - 2], s_mu[p]);
      h_pred[p,t] = normal_rng(mu_all[p,T + t], s_H);
    }
}

```

**r code**

```
setwd("~/docdis")
library(rstan)
library(dplyr)
library(tidyr)
#import data
d <- read.csv(file ='input/ch3/reginfotest.csv', header = TRUE,
                       stringsAsFactors = FALSE)

#long -> wide
d <- spread(d, key = year, value = mean)

data <- list(P = nrow(d),T = ncol(d) - 1,T_pred = 3,H = d[,-1])
stanmodel <- stan_model(file='model/ch3/model-treghapSNC_simpmatxp.stan')
fit <- sampling(
  stanmodel,
  data = data,
  seed =243,
  chains=4, iter=2000, warmup=1000, thin=1, control=list(adapt_delta=0.99, max_treedepth=15)
)

```

**warning message**

> 1: There were 68 divergent transitions after warmup. Increasing adapt\_delta above 0.99 may help. See  
> [Runtime warnings and convergence problems](http://mc-stan.org/misc/warnings.html#divergent-transitions-after-warmup)  
> 2: There were 2 chains where the estimated Bayesian Fraction of Missing Information was low. See  
> [Runtime warnings and convergence problems](http://mc-stan.org/misc/warnings.html#bfmi-low)  
> 3: Examine the pairs() plot to diagnose sampling problems

* * *

Then, I ran another stan code with reparameterization to solve them as follows, but got another warning message. I suppose that this message is related to mistakenly specified index, but I could not find any solutions for this. I would appreciate if someone would respond to me.

**stan code**

```
 data {
   int P;
   int T;
   int T_pred;
   real<lower=0, upper=10> H[P,T];
 }
 
 parameters {
   real<lower=0> s_mu;
   real mu_H_raw[P,T-2];
   real<lower=0> s_H;
 }
 
 transformed parameters {
   real mu_H[P,T];
   for (t in 3:T)
     for (p in 1:P)
       mu_H[p,t] = 2 * mu_H[p,t - 1] - mu_H[p,t - 2]
                 + s_mu * mu_H_raw[p,t]; //reparameterization
 }
 model {
   for (t in 3:T)
     for (p in 1:P){
       mu_H_raw[p,t] ~ normal(0, 1); //reparameterization
       H[p,t] ~ normal(mu_H[p,t], s_H);
     }
 }
 
 generated quantities {
   real mu_all[P,T + T_pred];
   real h_pred[P,T_pred];
   for (t in 1:T)
     for (p in 1:P)
       mu_all[p,t] = mu_H[p,t];
   for (t in 1:T_pred)
     for (p in 1:P){
       mu_all[p,T + t] = 2 * mu_all[p,t - 1] - mu_all[p,t - 2]
                         + s_mu * normal_rng(0, 1);
       h_pred[p,t] = normal_rng(mu_all[p,T + t], s_H);
     }
 }

```

**r code**

```
setwd("~/docdis")
library(rstan)
library(dplyr)
library(tidyr)
#import data
d <- read.csv(file ='input/ch3/reginfotest.csv', header = TRUE,
                       stringsAsFactors = FALSE)

#long -> wide
d <- spread(d, key = year, value = mean)

data <- list(P = nrow(d),T = ncol(d) - 1,T_pred = 3,H = d[,-1])
stanmodel <- stan_model(file='model/ch3/model-treghapSNC_simpmatxrep.stan')
fit <- sampling(
  stanmodel,
  data = data,
  seed = 243,
  chains=4, iter=2000, warmup=1000, thin=1
)

```

**warning message**

> SAMPLING FOR MODEL ‘model-treghapSNC\_simpmatxrep’ NOW (CHAIN 1).  
> Unrecoverable error evaluating the log probability at the initial value.  
> Exception: : accessing element out of range. index 8 out of range; expecting index to be between 1 and 7; index position = 2mu\_H\_raw (in ‘model250c34c853fe\_model\_treghapSNC\_simpmatxrep’ at line 18)
> 
> [1] “Error in sampler$call\_sampler(args\_list[[i]]) : "  
> [2] " Exception: : accessing element out of range. index 8 out of range; expecting index to be between 1 and 7; index position = 2mu\_H\_raw (in ‘model250c34c853fe\_model\_treghapSNC\_simpmatxrep’ at line 18)”  
> [1] “error occurred during calling the sampler; sampling not done”

* * *

**session info**

> R version 3.4.1 (2017-06-30)  
> Platform: x86\_64-w64-mingw32/x64 (64-bit)  
> Running under: Windows \>= 8 x64 (build 9200)
> 
> Matrix products: default
> 
> locale:  
> [1] LC\_COLLATE=Japanese\_Japan.932 LC\_CTYPE=Japanese\_Japan.932  
> [3] LC\_MONETARY=Japanese\_Japan.932 LC\_NUMERIC=C  
> [5] LC\_TIME=Japanese\_Japan.932
> 
> attached base packages:  
> [1] stats graphics grDevices utils datasets methods base
> 
> other attached packages:  
> [1] ggmcmc\_1.1 tidyr\_0.6.3 dplyr\_0.7.1  
> [4] rstan\_2.16.2 StanHeaders\_2.16.0-1 ggplot2\_2.2.1
> 
> loaded via a namespace (and not attached):  
> [1] Rcpp\_0.12.11 compiler\_3.4.1 RColorBrewer\_1.1-2 plyr\_1.8.4  
> [5] bindr\_0.1 tools\_3.4.1 digest\_0.6.12 tibble\_1.3.3  
> [9] gtable\_0.2.0 lattice\_0.20-35 pkgconfig\_2.0.1 rlang\_0.1.1  
> [13] GGally\_1.3.1 parallel\_3.4.1 mvtnorm\_1.0-6 loo\_1.1.0  
> [17] bindrcpp\_0.2 gridExtra\_2.2.1 coda\_0.19-1 stats4\_3.4.1  
> [21] grid\_3.4.1 reshape\_0.8.6 inline\_0.3.14 glue\_1.1.1  
> [25] R6\_2.2.2 rethinking\_1.59 magrittr\_1.5 scales\_0.4.1  
> [29] codetools\_0.2-15 matrixStats\_0.52.2 MASS\_7.3-47 assertthat\_0.2.0  
> [33] colorspace\_1.3-2 labeling\_0.3 lazyeval\_0.2.0 munsell\_0.4.3

* * *

[reginfotest.csv](https://canada1.discourse-cdn.com/flex030/uploads/mc_stan/original/1X/81b255cd4d13fdfd7c4ab01057a513488fe4a7a6.csv) (7.6 KB)

---

<div class="post-metadata">

**Author:** ![Bob\_Carpenter](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bob_carpenter/32/9230_2.png) [@Bob\_Carpenter](https://discourse.mc-stan.org/u/Bob_Carpenter)\
**Post date:** [August 14, 2017, 3:42pm UTC](https://discourse.mc-stan.org/t/divergent-transitions-bfmi-low-in-a-state-space-model/1551/2 "2017-08-14T15:42:43Z")

</div>

> [@ytan](#):
>
> Exception: : accessing element out of range. index 8 out of range; expecting index to be between 1 and 7; index position = 2mu\_H\_raw (in ‘model250c34c853fe\_model\_treghapSNC\_simpmatxrep’ at line 18)

There’s a missing semicolon after the `2`. By “index position” it means which index.

Look up the line number and see what’s going wrong.

---

<div class="post-metadata">

**Author:** ![ytan](https://avatars.discourse-cdn.com/v4/letter/y/439d5e/32.png) [@ytan](https://discourse.mc-stan.org/u/ytan)\
**Post date:** [August 15, 2017, 3:52am UTC](https://discourse.mc-stan.org/t/divergent-transitions-bfmi-low-in-a-state-space-model/1551/3 "2017-08-15T03:52:46Z")

</div>

Dear Mr. Carpenter,

thank you for your advice.  
A semicolon is located in the next line.

But, after reading your comment, I noticed that an index of the same line was wrong, mu\_H\_raw[p,t], and changed it into mu\_H\_raw[p,t-2].

Then, I ran this program, and got the different error message.

> SAMPLING FOR MODEL ‘model-treghapSNC\_simpmatx2’ NOW (CHAIN 1).  
> Rejecting initial value:  
> Error evaluating the log probability at the initial value.  
> Exception: normal\_lpdf: Location parameter is nan, but must be finite! (in ‘model39dc68f93d8\_model\_treghapSNC\_simpmatx2’ at line 25)  
> …  
> Initialization between (-2, 2) failed after 100 attempts.  
> Try specifying initial values, reducing ranges of constrained values, or reparameterizing the model.  
> [1] “Error in sampler$call\_sampler(args\_list[[i]]) : Initialization failed.”  
> [1] “error occurred during calling the sampler; sampling not done”

## Stan code

```
data {
  int P;
  int T;
  int T_pred;
  real<lower=0, upper=10> H[P,T];
}
 
parameters {
  real<lower=0> s_mu;
  real mu_H_raw[P,T-2];
  real<lower=0> s_H;
}
 
transformed parameters {
  real mu_H[P,T];
  for (t in 3:T)
    for (p in 1:P)
      mu_H[p,t] = 2 * mu_H[p,t - 1] - mu_H[p,t - 2] + s_mu * mu_H_raw[p,t - 2]; //reparameterization
 } 
 
model {
  for (t in 3:T)
    for (p in 1:P){
      mu_H_raw[p,t] ~ normal(0, 1); //reparameterization
      H[p,t] ~ normal(mu_H[p,t], s_H);
    }
}
 
generated quantities {
  real mu_all[P,T + T_pred];
  real h_pred[P,T_pred];
  for (t in 1:T)
    for (p in 1:P)
      mu_all[p,t] = mu_H[p,t];
  for (t in 1:T_pred)
    for (p in 1:P){
      mu_all[p,T + t] = 2 * mu_all[p,t - 1] - mu_all[p,t - 2] + s_mu * normal_rng(0, 1);
      h_pred[p,t] = normal_rng(mu_all[p,T + t], s_H);
    }
}

```

* * *

I looked up the line 25, and supposed that mu\_H[p,t] had a problem about the value constraint  
because H[P,T] can take only integers 0 to 10.

Following my Stan textbook (Matsuura. K, 2016, p168 [in Japanese]), I added two lines in the model block to avoid including unexpected values.

> ```
> if (mu_H[p,t] > 10 || mu_H[p,t] < 0 )
> target += negative_infinity();
> 
> ```

## Stan code

```
data {
  int P;
  int T;
  int T_pred;
  real<lower=0, upper=10> H[P,T];
}
 
parameters {
  real<lower=0> s_mu;
  real mu_H_raw[P,T-2];
  real<lower=0> s_H;
}
 
transformed parameters {
  real mu_H[P,T];
  for (t in 3:T)
    for (p in 1:P)
      mu_H[p,t] = 2 * mu_H[p,t - 1] - mu_H[p,t - 2] + s_mu * mu_H_raw[p,t - 2]; //reparameterization
 } 
 
model {
  for (t in 3:T)
    for (p in 1:P){
      mu_H_raw[p,t] ~ normal(0, 1); //reparameterization
      if (mu_H[p,t] > 10 || mu_H[p,t] < 0 )
      target += negative_infinity(); // to avoid including unexpected values
      H[p,t] ~ normal(mu_H[p,t], s_H);
    }
}
 
generated quantities {
  real mu_all[P,T + T_pred];
  real h_pred[P,T_pred];
  for (t in 1:T)
    for (p in 1:P)
      mu_all[p,t] = mu_H[p,t];
  for (t in 1:T_pred)
    for (p in 1:P){
      mu_all[p,T + t] = 2 * mu_all[p,t - 1] - mu_all[p,t - 2] + s_mu * normal_rng(0, 1);
      h_pred[p,t] = normal_rng(mu_all[p,T + t], s_H);
    }
}

```

But, the same error message appeared.

> Rejecting initial value:  
> Error evaluating the log probability at the initial value.  
> Exception: normal\_lpdf: Location parameter is nan, but must be finite! (in ‘model39dc38dd7471\_model\_treghapSNC\_simpmatx2’ at line 27)  
> …  
> Initialization between (-2, 2) failed after 100 attempts.  
> Try specifying initial values, reducing ranges of constrained values, or reparameterizing the model.  
> [1] “Error in sampler$call\_sampler(args\_list[[i]]) : Initialization failed.”  
> [1] “error occurred during calling the sampler; sampling not done”

I also set initial values in the R code as follows after reading this message, but it did not work.

```
P = nrow(d)
data <- list(P = nrow(d),T = ncol(d) - 1,T_pred = 3,H = d[,-1])
stanmodel <- stan_model(file='model/ch3/model-treghapSNC_simpmatx2.stan')
fit <- sampling(
  stanmodel,
  data = data,
  seed = 243,
  chains=4,
  iter=2000,
  warmup=1000,
  thin=1,
  init=function(){
    list(mu_h[p,1]=rnorm(P,6.2,0.1),s_H=1)
  }
)

```

---

<div class="post-metadata">

**Author:** ![dlakelan](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/dlakelan/32/2219_2.png) [@dlakelan](https://discourse.mc-stan.org/u/dlakelan)\
**Post date:** [August 15, 2017, 4:37pm UTC](https://discourse.mc-stan.org/t/divergent-transitions-bfmi-low-in-a-state-space-model/1551/4 "2017-08-15T16:37:24Z")

</div>

It looks to me like you need to initialize mu\_h[p,1] mu\_h[p,2] to some values before entering this loop:

> [@ytan](#):
>
> for (t in 3:T)  
> for (p in 1:P)  
> mu\_H[p,t] = 2 \* mu\_H[p,t - 1] - mu\_H[p,t - 2] + s\_mu \* mu\_H\_raw[p,t - 2]; //reparameterization

---

<div class="post-metadata">

**Author:** ![ytan](https://avatars.discourse-cdn.com/v4/letter/y/439d5e/32.png) [@ytan](https://discourse.mc-stan.org/u/ytan)\
**Post date:** [August 16, 2017, 11:59pm UTC](https://discourse.mc-stan.org/t/divergent-transitions-bfmi-low-in-a-state-space-model/1551/5 "2017-08-16T23:59:39Z")

</div>

Dear Mr.Lakeland,

thank you for your comment.  
First, I ran the following codes to initialize mu\_h[p,1] mu\_h[p,2] .

## Stan code

```
data {
  int P;
  int T;
  int T_pred;
  real<lower=0, upper=10> H[P,T];
}
 
parameters {
  real mu_h1;
  real mu_h2;
  real mu_H_raw[P,T-2];
  real<lower=0> s_mu;
  real<lower=0> s_mu_h1;
  real<lower=0> s_mu_h2;
  real<lower=0> s_H;
}
 
transformed parameters {
  real mu_H[P,T];
  for (t in 3:T)
    for (p in 1:P)
      mu_H[p,t] = 2 * mu_H[p,t - 1] - mu_H[p,t - 2] + s_mu * mu_H_raw[p,t - 2]; //reparameterization
 } 
 
model {
  for (p in 1:P){
  mu_H[p,1] ~ normal(mu_h1,s_mu_h1); // assuming mu_H[p,1] takes similar values across p.
  mu_H[p,2] ~ normal(mu_h2,s_mu_h2); // assuming mu_H[p,2] takes similar values across p.
  }
  for (t in 3:T)
    for (p in 1:P){
      mu_H_raw[p,t] ~ normal(0, 1); //reparameterization
      H[p,t] ~ normal(mu_H[p,t], s_H);
    }
}
 
generated quantities {
  real mu_all[P,T + T_pred];
  real h_pred[P,T_pred];
  for (t in 1:T)
    for (p in 1:P)
      mu_all[p,t] = mu_H[p,t];
  for (t in 1:T_pred)
    for (p in 1:P){
      mu_all[p,T + t] = 2 * mu_all[p,t - 1] - mu_all[p,t - 2] + s_mu * normal_rng(0, 1);
      h_pred[p,t] = normal_rng(mu_all[p,T + t], s_H);
    }
}

```

## R code

```
setwd("~/docdis")
library(rstan)
library(dplyr)
library(tidyr)
#import data
d <- read.csv(file ='input/ch3/reginfotest.csv', header = TRUE,
              stringsAsFactors = FALSE)

#long -> wide
d <- spread(d, key = year, value = mean)
P = nrow(d)
data <- list(P = nrow(d),T = ncol(d) - 1,T_pred = 3,H = d[,-1])
stanmodel <- stan_model(file='model/ch3/model-treghapSNC_simpmatx3.stan')
fit <- sampling(
  stanmodel,
  data = data,
  seed = 243,
  chains=4,
  iter=2000,
  warmup=1000,
  thin=1,
  init=function(){
    list(mu_h1=6.2, mu_h2=6.2, s_mu_h1=1, s_mu_h2=1, s_H=1)
  }
)

```

I set initial values based on data. But, I got the following warning and error message.

> DIAGNOSTIC(S) FROM PARSER:  
> Warning (non-fatal):  
> Left-hand side of sampling statement (~) may contain a non-linear transform of a parameter or local variable.  
> If it does, you need to include a target += statement with the log absolute determinant of the Jacobian of the transform.  
> Left-hand-side of sampling statement:  
> mu\_H[p, 1] ~ normal(…)  
> Warning (non-fatal):  
> Left-hand side of sampling statement (~) may contain a non-linear transform of a parameter or local variable.  
> If it does, you need to include a target += statement with the log absolute determinant of the Jacobian of the transform.  
> Left-hand-side of sampling statement:  
> mu\_H[p, 2] ~ normal(…)

> SAMPLING FOR MODEL ‘model-treghapSNC\_simpmatx3’ NOW (CHAIN 1).  
> Rejecting initial value:  
> Error evaluating the log probability at the initial value.  
> Exception: normal\_lpdf: Random variable is nan, but must not be nan! (in ‘model46f05584b36\_model\_treghapSNC\_simpmatx3’ at line 27)  
> …  
> Initialization between (-2, 2) failed after 100 attempts.  
> Try specifying initial values, reducing ranges of constrained values, or reparameterizing the model.  
> [1] “Error in sampler$call\_sampler(args\_list[[i]]) : Initialization failed.”  
> [1] “error occurred during calling the sampler; sampling not done”

* * *

Next, I constrained mu and sigma of the normal distribution to generate mu\_H[p,1] and mu\_H[p,2] by giving fixed values in the model block.  
but the same problem happens.

## Stan code

```
data {
  int P;
  int T;
  int T_pred;
  real<lower=0, upper=10> H[P,T];
}
 
parameters {
  real mu_H_raw[P,T-2];
  real<lower=0> s_mu;
  real<lower=0> s_H;
}
 
transformed parameters {
  real mu_H[P,T];
  for (t in 3:T)
    for (p in 1:P)
      mu_H[p,t] = 2 * mu_H[p,t - 1] - mu_H[p,t - 2] + s_mu * mu_H_raw[p,t - 2]; //reparameterization
 } 
 
model {
  for (p in 1:P){
  mu_H[p,1] ~ normal(6.2,1); // giving fixed values for mu and sigma
  mu_H[p,2] ~ normal(6.2,1); // giving fixed values for mu and sigma
  }
  for (t in 3:T)
    for (p in 1:P){
      mu_H_raw[p,t] ~ normal(0, 1); //reparameterization
      H[p,t] ~ normal(mu_H[p,t], s_H);
    }
}
 
generated quantities {
  real mu_all[P,T + T_pred];
  real h_pred[P,T_pred];
  for (t in 1:T)
    for (p in 1:P)
      mu_all[p,t] = mu_H[p,t];
  for (t in 1:T_pred)
    for (p in 1:P){
      mu_all[p,T + t] = 2 * mu_all[p,t - 1] - mu_all[p,t - 2] + s_mu * normal_rng(0, 1);
      h_pred[p,t] = normal_rng(mu_all[p,T + t], s_H);
    }
}

```

## R code

```
setwd("~/docdis")
library(rstan)
library(dplyr)
library(tidyr)
#import data
d <- read.csv(file ='input/ch3/reginfotest.csv', header = TRUE,
              stringsAsFactors = FALSE)

#long -> wide
d <- spread(d, key = year, value = mean)
P = nrow(d)
data <- list(P = nrow(d),T = ncol(d) - 1,T_pred = 3,H = d[,-1])
stanmodel <- stan_model(file='model/ch3/model-treghapSNC_simpmatx4.stan')
fit <- sampling(
  stanmodel,
  data = data,
  seed = 243,
  chains=4,
  iter=2000,
  warmup=1000,
  thin=1,
  init=function(){
    list(s_H=1)
  }
)

```

> DIAGNOSTIC(S) FROM PARSER:  
> Warning (non-fatal):  
> Left-hand side of sampling statement (~) may contain a non-linear transform of a parameter or local variable.  
> If it does, you need to include a target += statement with the log absolute determinant of the Jacobian of the transform.  
> Left-hand-side of sampling statement:  
> mu\_H[p, 1] ~ normal(…)  
> Warning (non-fatal):  
> Left-hand side of sampling statement (~) may contain a non-linear transform of a parameter or local variable.  
> If it does, you need to include a target += statement with the log absolute determinant of the Jacobian of the transform.  
> Left-hand-side of sampling statement:  
> mu\_H[p, 2] ~ normal(…)

> SAMPLING FOR MODEL ‘model-treghapSNC\_simpmatx4’ NOW (CHAIN 1).  
> Rejecting initial value:  
> Error evaluating the log probability at the initial value.  
> Exception: normal\_lpdf: Random variable is nan, but must not be nan! (in ‘model46f030c02b2\_model\_treghapSNC\_simpmatx4’ at line 23)  
> …  
> Initialization between (-2, 2) failed after 100 attempts.  
> Try specifying initial values, reducing ranges of constrained values, or reparameterizing the model.  
> [1] “Error in sampler$call\_sampler(args\_list[[i]]) : Initialization failed.”  
> [1] “error occurred during calling the sampler; sampling not done”

---

<div class="post-metadata">

**Author:** ![Bob\_Carpenter](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bob_carpenter/32/9230_2.png) [@Bob\_Carpenter](https://discourse.mc-stan.org/u/Bob_Carpenter)\
**Post date:** [August 17, 2017, 1:19am UTC](https://discourse.mc-stan.org/t/divergent-transitions-bfmi-low-in-a-state-space-model/1551/6 "2017-08-17T01:19:41Z")

</div>

Was there no other error message for the inits? Have you updated to Stan 2.16? Some of the warnings were getting lost.

The problem here is that random inits are not returning finite log density values. you need to trace which variable is being used before it is defined, or which index it out of bound, etc. That’s why you need the warning messages.

---

<div class="post-metadata">

**Author:** ![ytan](https://avatars.discourse-cdn.com/v4/letter/y/439d5e/32.png) [@ytan](https://discourse.mc-stan.org/u/ytan)\
**Post date:** [August 17, 2017, 1:50am UTC](https://discourse.mc-stan.org/t/divergent-transitions-bfmi-low-in-a-state-space-model/1551/7 "2017-08-17T01:50:47Z")

</div>

My Rstan version is 2.16.2.  
Below the warning message I quoted, I found these lines. In the final part, I found a warning message. Do you mean this?

> In file included from C:/Users/yohei/Documents/R/win-library/3.4/BH/include/boost/config.hpp:39:0,  
> from C:/Users/yohei/Documents/R/win-library/3.4/BH/include/boost/math/tools/config.hpp:13,  
> from C:/Users/yohei/Documents/R/win-library/3.4/StanHeaders/include/stan/math/rev/core/var.hpp:7,  
> from C:/Users/yohei/Documents/R/win-library/3.4/StanHeaders/include/stan/math/rev/core/gevv\_vvv\_vari.hpp:5,  
> from C:/Users/yohei/Documents/R/win-library/3.4/StanHeaders/include/stan/math/rev/core.hpp:12,  
> from C:/Users/yohei/Documents/R/win-library/3.4/StanHeaders/include/stan/math/rev/mat.hpp:4,  
> from C:/Users/yohei/Documents/R/win-library/3.4/StanHeaders/include/stan/math.hpp:4,  
> from C:/Users/yohei/Documents/R/win-library/3.4/StanHeaders/include/src/stan/model/model\_header.hpp:4,  
> from file249c62e84a86.cpp:8:  
> C:/Users/yohei/Documents/R/win-library/3.4/BH/include/boost/config/compiler/gcc.hpp:186:0: warning: “BOOST\_NO\_CXX11\_RVALUE\_REFERENCES” redefined
> 
> # define BOOST\_NO\_CXX11\_RVALUE\_REFERENCES
> 
> ^  
> :0:0: note: this is the location of the previous definition
