@@ -327,14 +327,14 @@ inline auto wiener_lpdf(const T_y& y, const T_a& a, const T_t0& t0,
327327 return ret_t (0 );
328328 }
329329
330- using T_y_ref = ref_type_if_t <!is_constant<T_y>::value, T_y>;
331- using T_a_ref = ref_type_if_t <!is_constant<T_a>::value, T_a>;
332- using T_v_ref = ref_type_if_t <!is_constant<T_v>::value, T_v>;
333- using T_w_ref = ref_type_if_t <!is_constant<T_w>::value, T_w>;
334- using T_t0_ref = ref_type_if_t <!is_constant<T_t0>::value, T_t0>;
335- using T_sv_ref = ref_type_if_t <!is_constant<T_sv>::value, T_sv>;
336- using T_sw_ref = ref_type_if_t <!is_constant<T_sw>::value, T_sw>;
337- using T_st0_ref = ref_type_if_t <!is_constant<T_st0>::value, T_st0>;
330+ using T_y_ref = ref_type_t < T_y>;
331+ using T_a_ref = ref_type_t < T_a>;
332+ using T_v_ref = ref_type_t < T_v>;
333+ using T_w_ref = ref_type_t < T_w>;
334+ using T_t0_ref = ref_type_t < T_t0>;
335+ using T_sv_ref = ref_type_t < T_sv>;
336+ using T_sw_ref = ref_type_t < T_sw>;
337+ using T_st0_ref = ref_type_t < T_st0>;
338338
339339 using T_partials_return
340340 = partials_return_t <T_y, T_a, T_t0, T_w, T_v, T_sv, T_sw, T_st0>;
@@ -449,6 +449,9 @@ inline auto wiener_lpdf(const T_y& y, const T_a& a, const T_t0& t0,
449449 // calculate density and partials
450450 for (size_t i = 0 ; i < N; i++) {
451451 if (sw_vec[i] == 0 && st0_vec[i] == 0 ) {
452+ // note: because we're delegating to wiener5_lpdf,
453+ // we need to make sure is_constant is consistent between
454+ // our inputs and these
452455 result += wiener_lpdf<propto>(y_vec[i], a_vec[i], t0_vec[i], w_vec[i],
453456 v_vec[i], sv_vec[i], precision_derivatives);
454457 continue ;
0 commit comments