the problem is a bit 'badly scaled'; using more O(1) coordinates make it
run more nicely. this is due to internal stuff in the code.
I attach a revised code, where the rescaling of the coordinates are just
borders = borders / 10^4
work[, "X"] = work[, "X"] /10^4
work[, "Y"] = work[, "Y"] /10^4
the constrained case now runs, although I strongly suspect there is very
little information in the data about the spatial component, and that is
why these data are 'difficult'.
--
INLA help <he...@r-inla.org>
R-INLA
yes, this is a recurrent theme.
if you have
f(i, ..., constr=TRUE)
is means that
sum(x) = 0,
say, in the model, hence we would like that
sum( E(x | y) ) = 0
so that
sum(result$summary.random$i$mean)
should be (close to zero). This is not necessarily so in INLA. (Well, it
will be not that far off but not zero.) This beacuse, the marginal
expectation E( x_i | y) is computed from the marginal of x_i|y which
again is computed under the model where sum(x) = 0. However, the
estimate of x_i|y is done 'independently' for each i, so we do not 'see
the sum(x)=0 constraint' a posteriori, so even though sum(x)=0 apriori,
there is not 'joint distribution' a posteriori that will ensure that
sum(x)=0 also aposteriori. We only do the best guess we can for each i.
Only if strategy="gaussian", you will get that sum(E(x|y)) = 0 (or close
to zero), as the sum(x)=0 constraint survive after conditioning on
data.
Similar for the more general constraints, Ax=e.
> This data were simulated based on residential locations. Thus,
> clustering is expected since people tends to live close to each other.
> SPDE is ideal for health application since it can handle clustered
> point patterns on large spatial domain effectively.
>
binary data are known to be difficult as there is little information in
it, more informative priors on the SPDE model would help from INLA's
point of view.
Thanks for your advices. I have changed my code accordingly. In addtion, I fixed an error in my code so that linear constraints match the non-normal observations. However,the constraint SPDE model still diverged: optimizer jumped back and forth on a ridge towardinfinity. I have tried setting diagonal option in control.inla , prec and prec.intercept in control.fixed. Neither fixed the problem. This is puzzling to me since these linear constraints were supposed to improve the parameterization of the model, and the computing. Please advise the attached code puzzle.R
<puzzle.R>