Thanks all for taking the time to respond to my post.
Andrew's comment about the scaling of the parameters relates to
sampling efficiency (from what I understand). I am still stuck with
the more basic issue of getting the sampler to run.
Following Ben B's suggestion, I have now written and tested a
user-defined function for evaluating the dlm log density. I copied
the source code for gaussian_dlm_obs_lpdf using the link that Ben B
sent. Then I edited it so that it was consistent with the
higher-level Stan syntax.
So I now have an R function called 'model_test' that was generated by
the command,
expose_stan_functions('./neural_dlm.stan')
I think that 'model_test' evaluates the log density of the dlm.
However in contrast to the corresponding Stan function
'gaussian_dlm_obs', it returns finite log densities:
--------------------------------
> model_test(y, N, h, sigma_obs, ..., alpha)
[1] 771.6542
--------------------------------
And as before, when I run a Stan program that includes
'y ~ gaussian_dlm_obs(F, G, V, W, m0, C0);'
I get the following error message,
------------------------------
Rejecting initial value:
Error evaluating the log probability at the initial value.
[1] "Error in eval(expr, envir, enclos) : Initialization failed."
[1] "error occurred during calling the sampler; sampling not done"
------------------------------
I have attached my updated .stan and .R files.
As an aside, I think 'expose_stan_functions' is great feature, and am
slowly becoming a fan of Stan as a whole.
Philip
> You received this message because you are subscribed to a topic in the
> Google Groups "Stan users mailing list" group.
> To unsubscribe from this topic, visit
>
https://groups.google.com/d/topic/stan-users/x3OOBRQH7T4/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
--
------------------------------------
Philip Maybank
+44 (0)7407 219 422