<div dir="ltr"><div>Olá pessoal estou fazendo uma modelagem geoestatística pelo INLA, 
mas estou com dúvidas quanto às estimativas para os intervalos de 
credibilidade maiores, p.ex. 95%, para esta situação os valores 
estimados fogem do campo amostral que é de 0,3 a 0,7. Alguém sabe onde 
posso configurar para que as estimativas fiquem nesse intervalo. Segue o
 código: <br><br>## Criando domain<br>IEBdomain <- inla.nonconvex.hull(as.matrix(<wbr>dados[,1:2]), -0.03, -0.05, resolution=c(100,100))<br><br>## Crando mesh<br>IEBmesh <- inla.mesh.2d(boundary=<wbr>IEBdomain, max.edge=c(35,35), cutoff=35, offset=c(-0.5, -0.5))<br>plot(IEBmesh, asp=1, main='')<br><br>## spde matern 0.5 = exponetial<br>IEBspde <- inla.spde2.matern(mesh=<wbr>IEBmesh,alpha=2)<br><br>mesh.index <- inla.spde.make.index(name = "i",<br>                              <wbr>    n.spde = IEBspde$n.spde)<br><br>## Matriz projetora estimativa<br>A.est <- inla.spde.make.A(IEBmesh, loc=as.matrix(dados[,1:2]))<br><br>## Matriz de covariaveis selecionadas pelo AIC, estatistica frequentista<br>covars <- dados[,c(1:4,6:23)]<br><br>stk.est <- inla.stack(data=list(y=dados$<wbr>IEB_ANO), A=list(A.est,1), tag="est",<br>                      effects=list(c(mesh.index,<wbr>list(Intercept=1)),<br>                              <wbr>       list(covars)))<br><br>stk.val <- inla.stack(data=list(y=NA), A=list(A.est,1), tag="est",<br>                      effects=list(c(mesh.index,<wbr>list(Intercept=1)),<br>                              <wbr>       list(covars)))<br>## Matriz projetora predicao<br>A.pred = inla.spde.make.A(IEBmesh)<br>stk.pred = inla.stack(data = list(y = NA),<br>                      A = list(A.pred),tag = "pred",<br>                      effects=list(c(mesh.index,<wbr>list(Intercept=1))))<br><br>str(stk.pred)<br>stk.all <- inla.stack(stk.est, stk.val,stk.pred)<br><br>## Testar qual variável tem menor DIC<br>names(covars)<br>f.IEB <- y ~ -1 + Intercept + Dens.dren + f(i, model=IEBspde)<br>names(inla.models()$<wbr>likelihood)<br>r.IEB <-inla(f.IEB,family="beta", control.compute=list(dic=TRUE)<wbr>,quantiles=c(0.025,0.1,0.5, 0.975),<br>              data=inla.stack.data(stk.all,<wbr>spde=IEBspde), control.predictor=list(A=inla.<wbr>stack.A(stk.all),compute=TRUE)<wbr>)<br><br>names(r.IEB)<br>r.IEB$dic$dic<br>r.IEB$summary.fixed<br>r.IEB$summary.hyper[1,]<br>r.IEB$summary.hyper[-1,]<br><br>result <- inla.spde2.result(r.IEB, "i", IEBspde)<br>names(result)<br>str(r.IEB$marginals.hyperpar)<br><br>## Posterior mean<br>inla.emarginal(function(x) x, result$marginals.variance.<wbr>nominal[[1]])<br>inla.emarginal(function(x) x, result$marginals.range.<wbr>nominal[[1]])<br><br>## Quantis<br>inla.qmarginal(c(0.025,0.5,0.<wbr>975), result$marginals.variance.<wbr>nominal[[1]])<br>inla.qmarginal(c(0.025,0.5,0.<wbr>975), result$marginals.range.<wbr>nominal[[1]])<br><br>par(mfrow=c(2,3), mar=c(3,3.5,0,0), mgp=c(1.5, .5, 0), las=0)<br><br>plot(r.IEB$marginals.fix[[1]], type='l', xlab=expression(beta[0]), ylab='Density')<br>plot(r.IEB$marginals.fix[[2]], type='l', xlab=expression(beta[1]),ylab=<wbr>'Density')<br>plot(r.IEB$marginals.hy[[1]], type='l', xlab=expression(phi),ylab='<wbr>Density')<br><br>plot.default(inla.tmarginal(<wbr>function(x) 1/exp(x), r.IEB$marginals.hy[[3]]), type='l',<br>             xlab=expression(kappa), ylab='Density')<br>plot.default(result$marginals.<wbr>variance.nominal[[1]], type='l', xlab=expression(sigma[x]^2), ylab='Density')<br>plot.default(result$marginals.<wbr>range.nominal[[1]], type='l', xlab='Practical range',<br>             ylab='Density')<br><br>index.pred <- inla.stack.index(stk.all, "pred")$data<br><br>names(r.IEB$summary.linear.<wbr>predictor)<br><br>linpred.mean <- r.IEB$summary.linear.<wbr>predictor[index.pred,"mean"]<br>linpred.2.5 <- r.IEB$summary.linear.<wbr>predictor[index.pred,"0.<wbr>025quant"]<br>linpred.10 <- r.IEB$summary.linear.<wbr>predictor[index.pred,"0.<wbr>1quant"]<br>linpred.50 <- r.IEB$summary.linear.<wbr>predictor[index.pred,"0.<wbr>5quant"]<br>linpred.97.5 <- r.IEB$summary.linear.<wbr>predictor[index.pred,"0.<wbr>975quant"]<br><br>(nxy <- round(c(diff(c(200,800)), diff(c(6700,7200)))))<br>proj <- inla.mesh.projector(IEBmesh, xlim=c(200,800), ylim=c(6700,7200), dims=nxy)<br><br>lp.mean.grid <- inla.mesh.project(proj, linpred.mean)<br>lp.2.5.grid <- inla.mesh.project(proj, linpred.2.5)<br>lp.10.grid <- inla.mesh.project(proj, linpred.10)<br>lp.50.grid <- inla.mesh.project(proj, linpred.50)<br>lp.97.5.grid <- inla.mesh.project(proj, linpred.97.5)<br><br>par(mfrow=c(2,3), mar=c(3,3.5,0,0), mgp=c(1.5, .5, 0), las=0)<br><br>image(lp.2.5.grid)<br>image(lp.10.grid)<br>image(lp.mean.grid)<br>image(lp.97.5.grid)<br><br><br></div>Abraço   <br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><span style="font-size:medium"><b><i>Wagner Wolff, </i></b></span><i><b>PhD</b></i><br>"<b>Luiz de Queiroz</b><b><span>"</span> College of Agriculture,</b><br>University of São Paulo<br>Pádua Dias avenue11 | 13418-900| Piracicaba-SP| Brazil<br>Phone:  <a href="tel:+55%2019%2098238-5582" value="+5519982385582" target="_blank">+55 19 982385582</a>  <br><span><span><a href="http://orcid.org/0000-0003-3426-308X" target="_blank">http://orcid.org/0000-0003-3426-308X</a><br><a href="https://github.com/wwolff7" target="_blank">https://github.com/wwolff7</a><br><a href="http://buscatextual.cnpq.br/buscatextual/visualizacv.do?id=K4463141A1" target="_blank">http://buscatextual.cnpq.br/buscatextual/visualizacv.do?id=K4463141A1</a></span></span></div></div>
</div>