Hi all.
I am trying to implement the BEKK model(https://arxiv.org/pdf/math/0702815.pdf) using Stan and I face the following problem. When adding terms like A * A^T it returns some exceptions (probably because of float precision). I would appreciate any help to avoid this problem. The following is that part of my code and the exception message.
Best,
Edgar
parameters {
matrix[N,N] A;
matrix[N,N] B;
cov_matrix[N] S0;
}
transformed parameters {
cov_matrix[N] S[T];t
for(t in 1:T)
{
if (t == 1){
S[t] = S0;
}
else{
S[t] = S0 + A * y[t-1] * y[t-1]' * A' + B * S[t-1] * B'; // the line that
// throws the
// exception
}
}
}