I've set up a model to use with MCEM. I can get the bootstrap filter working with this model and it compiles, however, when running the EM algorithm it diverges:
```
## Compilation
brownianModel <-
nimbleModel(brownianModelCode1,
constants=list(N=N,J=J,NT=NT,
deltaT=deltaT,
tasks=tasks),
dimensions=list(p=c(N,NT,3L)),
inits=bminits,check=FALSE,
data=list(y=y),
buildDerivs = TRUE)
cBrownianModel <-
compileNimble(brownianModel,showCompilerOutput=FALSE)
brownianMCEM <-
buildMCEM(model=brownianModel,latentNodes="theta")
cBrownianMCEM <-
compileNimble(brownianMCEM,project=brownianModel)
## Run MCEM (this step fails)
cBrownianMCEM$findMLE(initM=1000)
```
This last gives an error:
```
## Error in cBrownianMCEM$findMLE(initM
= 1000) :
## Non-finite log-likelihood occurred; the MCEM optimization cannot continue.
## Please check the state of the compiled model (accessible as 'name_of_model$CobjectInterface')
## and determine which parameter values are causing the invalid log-likelihood by calling
## 'calculate' with subsets of the model parameters
## (e.g., 'name_of_model$CobjectInterface$calculate('y[3]')'
## to see if node 'y[3]' is the cause of the problem). Note that if your model is maximizing
## over parameters whose bounds are not constant (i.e., depend on other parameters),
## this is one possible cause of such problems; in that case you might try running the MCEM
## without bounds, by setting 'forceNoConstraints = TRUE'.
```
This error message doesn't reflect the current version of nimble,
as `cBrownianMCEM` does not have a
`$CobjectInterface` field, although
`brownianMCEM$.CobjectInterface` is an object. But this
doesn't have a `$calculate()` method.
The `brownianModel` and `cBrownianModel` objects do have a
`calculate()` method, but I'm
not sure that their parameter values are referencing.
Q1. How do I access the values at the point in which MCEM blew up
to diagnose the problem?
Q2. Is there a way to turn on tracing for the MCEM algorithm?
There seems to be an undocumented `optimControl` parameter which
can be set in `control`,
but tracing at that level would trace within the M-step and I want
to trace the EM algorithm.
(As that error message clearly needs to be fixed, I posted Issue
#1535 on github. I've got the complete
model and some test data there if you are curious).
Thanks,
--Russell
-- Russell Almond https://ralmond.net/
--
You received this message because you are subscribed to the Google Groups "nimble-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nimble-users...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/nimble-users/5a47513f-c23b-4ba1-b0a3-68b7c00bf815%40gmail.com.
To view this discussion visit https://groups.google.com/d/msgid/nimble-users/38c5e2b2-7e0b-49bc-a797-b864f3169485n%40googlegroups.com.