Hi,

Recently I am writing an Stan code which involves defining the log likelihood of some data which would be used later in the ‘model’ trunk.

First I tried:

```
transformed parameters{
vector[N] log_lik;
for (i in 1:N){
log_lik[i] += normal_lpdf(y|mu, sigma);
}
}
```

But the model returns error like ‘Chain 1: Rejecting initial value:

Chain 1: Log probability evaluates to log(0), i.e. negative infinity.

Chain 1: Stan can’t start sampling from this initial value.’

But when I modified the code as:

```
transformed parameters{
vector[N] log_lik = rep_vector(0,N);
for (i in 1:N){
log_lik[i] += normal_lpdf(y|mu, sigma);
}
}
```

The model could run without any error. May I ask that why this would happen?

Thx!