Sure. Here’s the error:
/tmp/RtmpgEpPax/model-c8f35b59817e.hpp: In member function ‘stan::scalar_type_t<T2> none_model_NA_NA_NA_none_NA_1_model_namespace::none_model_NA_NA_NA_none_NA_1_model::log_prob_impl(VecR&, VecI&, std::ostream*) const’:
/tmp/RtmpgEpPax/model-c8f35b59817e.hpp:1000:48: error: ‘inline_mike_dot_return_sym1__’ was not declared in this scope
1000 | stan::math::normal_lpdf<propto__>(Y, inline_mike_dot_return_sym1__,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make: *** [make/program:58: /tmp/RtmpgEpPax/model-c8f35b59817e] Error 1
Error: An error occured during compilation! See the message above for more information.
And here’s an example stan model that triggers that error:
functions{
row_vector mike_dot(
int r
, int c
, vector beta
, row_vector zeros
, array[,] int index_pos_X_mat
, array[] int index_pos_X_sizes
, array[,] int col_index_into_X_first_unique_pos_X_mat
, array[] int col_index_into_X_first_unique_pos_X_sizes
, array[,] int index_of_cZ_for_each_col_in_Z_with_pos_X_mat
, array[] int index_of_cZ_for_each_col_in_Z_with_pos_X_sizes
, array[,] int index_neg_X_mat
, array[] int index_neg_X_sizes
, array[,] int col_index_into_X_first_unique_neg_X_mat
, array[] int col_index_into_X_first_unique_neg_X_sizes
, array[,] int index_of_cZ_for_each_col_in_Z_with_neg_X_mat
, array[] int index_of_cZ_for_each_col_in_Z_with_neg_X_sizes
) {
row_vector[c] out = zeros ;
for(i_r in 1:r){
out[
index_pos_X_mat[
i_r
, 1:(index_pos_X_sizes[i_r])
]
] = (
out[
col_index_into_X_first_unique_pos_X_mat[
i_r
, 1:(col_index_into_X_first_unique_pos_X_sizes[i_r])
]
]
+ beta[i_r]
)[
index_of_cZ_for_each_col_in_Z_with_pos_X_mat[
i_r
, 1:(index_of_cZ_for_each_col_in_Z_with_pos_X_sizes[i_r])
]
] ;
out[
index_neg_X_mat[
i_r
, 1:(index_neg_X_sizes[i_r])
]
] = (
out[
col_index_into_X_first_unique_neg_X_mat[
i_r
, 1:(col_index_into_X_first_unique_neg_X_sizes[i_r])
]
]
- beta[i_r]
)[
index_of_cZ_for_each_col_in_Z_with_neg_X_mat[
i_r
, 1:(index_of_cZ_for_each_col_in_Z_with_neg_X_sizes[i_r])
]
] ;
}
return(out);
}
}
data{
int r ;
int c ;
matrix[r,c] X;
row_vector[c] Y;
int index_pos_X_mat_rows ;
int index_pos_X_mat_cols ;
array[index_pos_X_mat_rows,index_pos_X_mat_cols] int index_pos_X_mat ;
array[index_pos_X_mat_rows] int index_pos_X_sizes ;
int col_index_into_X_first_unique_pos_X_mat_rows ;
int col_index_into_X_first_unique_pos_X_mat_cols ;
array[
col_index_into_X_first_unique_pos_X_mat_rows
,col_index_into_X_first_unique_pos_X_mat_cols
] int col_index_into_X_first_unique_pos_X_mat ;
array[
col_index_into_X_first_unique_pos_X_mat_rows
] int col_index_into_X_first_unique_pos_X_sizes ;
int index_of_cZ_for_each_col_in_Z_with_pos_X_mat_rows ;
int index_of_cZ_for_each_col_in_Z_with_pos_X_mat_cols ;
array[
index_of_cZ_for_each_col_in_Z_with_pos_X_mat_rows
, index_of_cZ_for_each_col_in_Z_with_pos_X_mat_cols
] int index_of_cZ_for_each_col_in_Z_with_pos_X_mat ;
array[
index_of_cZ_for_each_col_in_Z_with_pos_X_mat_rows
] int index_of_cZ_for_each_col_in_Z_with_pos_X_sizes ;
int index_neg_X_mat_rows ;
int index_neg_X_mat_cols ;
array[index_neg_X_mat_rows,index_neg_X_mat_cols] int index_neg_X_mat ;
array[index_neg_X_mat_rows] int index_neg_X_sizes ;
int col_index_into_X_first_unique_neg_X_mat_rows ;
int col_index_into_X_first_unique_neg_X_mat_cols ;
array[
col_index_into_X_first_unique_neg_X_mat_rows
,col_index_into_X_first_unique_neg_X_mat_cols
] int col_index_into_X_first_unique_neg_X_mat ;
array[
col_index_into_X_first_unique_neg_X_mat_rows
] int col_index_into_X_first_unique_neg_X_sizes ;
int index_of_cZ_for_each_col_in_Z_with_neg_X_mat_rows ;
int index_of_cZ_for_each_col_in_Z_with_neg_X_mat_cols ;
array[
index_of_cZ_for_each_col_in_Z_with_neg_X_mat_rows
, index_of_cZ_for_each_col_in_Z_with_neg_X_mat_cols
] int index_of_cZ_for_each_col_in_Z_with_neg_X_mat ;
array[
index_of_cZ_for_each_col_in_Z_with_neg_X_mat_rows
] int index_of_cZ_for_each_col_in_Z_with_neg_X_sizes ;
}
transformed data{
row_vector[c] zeros = zeros_row_vector(c) ;
}
parameters{
vector[r] beta ;
}
transformed parameters{
}
model{
row_vector[c] Z_mike ;
profile("mike"){
Z_mike = mike_dot(
r
, c
, beta
, zeros
, index_pos_X_mat
, index_pos_X_sizes
, col_index_into_X_first_unique_pos_X_mat
, col_index_into_X_first_unique_pos_X_sizes
, index_of_cZ_for_each_col_in_Z_with_pos_X_mat
, index_of_cZ_for_each_col_in_Z_with_pos_X_sizes
, index_neg_X_mat
, index_neg_X_sizes
, col_index_into_X_first_unique_neg_X_mat
, col_index_into_X_first_unique_neg_X_sizes
, index_of_cZ_for_each_col_in_Z_with_neg_X_mat
, index_of_cZ_for_each_col_in_Z_with_neg_X_sizes
) ;
}
beta ~ std_normal() ;
Y ~ normal(Z_mike,1.0) ;
}
generated quantities{
}