You should be able to call log_prob with double arrays, but
it looks like that's broken. It should be defined to
do exactly what you had to code by hand.
I have to recode the log_prob function so that we can use
it for RM-HMC, and at that point, the calls will change
slightly and doubles will definitely be supported. I'll
let you know when that happens.
- Bob
On 2/24/13 2:40 PM, Jiqiang Guo wrote:
> Suggested from the error, I am using std::agrad::var and it at least compiles. So now I have
>
> vector<stan::agrad::var> par_r2(par_r.size());
> for (size_t i = 0; i < par_r.size(); i++)
> par_r2[i] = par_r[i];
> vector<int> par_i(model_.num_params_i(), 0);
> double lp = model_.log_prob(par_r2, par_i, &rstan::io::rcout).val();
>
> --
> Jiqiang
>
>
> On Sun, Feb 24, 2013 at 2:21 PM, Jiqiang Guo <
guo...@gmail.com <mailto:
guo...@gmail.com>> wrote:
>
> The error message is:
>
> error: non-const lvalue reference to type
> 'vector<stan::agrad::var>' cannot bind to a value of unrelated type 'std::vector<double>'
> double lp = model_.log_prob(par_r, par_i, &rstan::io::rcout);
> ^~~~~
> normal_mean_model.cpp:245:35: note: in instantiation of member function
> 'rstan::stan_fit<normal_mean_model_namespace::normal_mean_model,
> boost::random::additive_combine_engine<boost::random::linear_congruential_engine<unsigned int, 40014, 0,
>
2147483563 <tel:
2147483563>>, boost::random::linear_congruential_engine<unsigned int, 40692, 0,
2147483399
> <tel:
2147483399>> > >::log_prob'
> stan-dev+unsubscribe@__
googlegroups.com <mailto:
stan-dev%2Bunsu...@googlegroups.com>
> <mailto:
stan-dev%__2Buns...@googlegroups.com <mailto:
stan-dev%252Buns...@googlegroups.com>__>.
>
> For more options, visit
https://groups.google.com/__groups/opt_out
> <
https://groups.google.com/groups/opt_out>.
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups "stan development mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> stan-dev+unsubscribe@__
googlegroups.com <mailto:
stan-dev%2Bunsu...@googlegroups.com>.
> For more options, visit
https://groups.google.com/__groups/opt_out <
https://groups.google.com/groups/opt_out>.
>
>
>
> --
> You received this message because you are subscribed to the Google Groups "stan development mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> stan-dev+unsubscribe@__
googlegroups.com <mailto:
stan-dev%2Bunsu...@googlegroups.com>.
> For more options, visit
https://groups.google.com/__groups/opt_out <
https://groups.google.com/groups/opt_out>.
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups "stan development mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
stan-dev+u...@googlegroups.com.