<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Wagner, <br>
    </p>
    <p>Você não colocou covariáveis na 'stk.pred' (veja o comentário no
      topo da pag. 24 do link que vc enviou). <br>
    </p>
    <p>Não é necessário fazer uma stack para validacao se não há dados
      fora daqueles usados para estimar o modelo (para ser realmente uma
      validação) pois os preditos para 'stk.est' e 'stk.pred' serão a
      mesma coisa dado que o scenario é o mesmo. Note que na pagina 25
      do link foi usado outro scenario para validação, com 367 locais.<br>
    </p>
    Sobre o suporte da resposta, a verossimilhanca beta é uma boa opção.
    <br>
    <br>
    <br>
    Elias<br>
    <br>
    <div class="moz-cite-prefix">On 10/05/2017 13:55, Wagner Wolff
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAOyzcymQ7ZnHA2LO0P_SWaHD4OoK85cZVjiaRR_KoYZj5j9BDA@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div>
            <div>Olá Elias obrigado pela ajuda!<br>
              <br>
            </div>
            Estou considerando só o efeito espacial (aleatório)? Pensei 
            que estivesse incluso o fixo (covaráveis) também. Como
            acrescento os dois na predição? Talvez isso resolva meu
            problema.<br>
            <br>
          </div>
          <div>Quanto ao stk.val eu criei ele para comparar os dados
            observados com os preditos, como explicado em <b><a
                moz-do-not-send="true"
href="http://www.math.sciences.univ-nantes.fr/%7Elavancie/slides_GT/INLA_report2012.pdf">http://www.math.sciences.univ-nantes.fr/~lavancie/slides_GT/INLA_report2012.pdf</a>
            </b>na página 25.<br>
          </div>
          <div><br>
          </div>
          Outra questão é a seguinte. Os dados são do tipo proporção,
          nesse caso é adequado usar a beta no inla(family=...)?<br>
          <br>
        </div>
        Abraço<br>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">2017-05-10 13:33 GMT-03:00 Elias T.
          Krainski via R-br <span dir="ltr"><<a
              moz-do-not-send="true"
              href="mailto:r-br@listas.c3sl.ufpr.br" target="_blank">r-br@listas.c3sl.ufpr.br</a>></span>:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000">
              <p>Olá Wagner, <br>
              </p>
              <p>No seu cenário de predição você está considerando
                apenas o efeito espacial. Isso só fará sentido num
                cenário sem covariáveis ou quando nenhuma for
                importante.<br>
              </p>
              <p>Bwt, não entendi porque você repete exatamente o mesmo
                cenário em 'stk.est' e 'stk.val'... para mim é
                redundante. <br>
              </p>
              <p>Att.<br>
              </p>
              <p>Elias.<br>
              </p>
              <div>
                <div class="h5"> <br>
                  <div class="m_-312923648872411721moz-cite-prefix">On
                    09/05/2017 17:18, Wagner Wolff via R-br wrote:<br>
                  </div>
                </div>
              </div>
              <blockquote type="cite">
                <div>
                  <div class="h5">
                    <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=IEBdomai<wbr>n,
                        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=IEBmesh<wbr>,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$I<wbr>EB_ANO),
                        A=list(A.est,1), tag="est",<br>
                                             
                        effects=list(c(mesh.index,list<wbr>(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,list<wbr>(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,list<wbr>(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()$likelihood<wbr>)<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,s<wbr>pde=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.nomi<wbr>nal[[1]])<br>
                        inla.emarginal(function(x) x,
                        result$marginals.range.nominal<wbr>[[1]])<br>
                        <br>
                        ## Quantis<br>
                        inla.qmarginal(c(0.025,0.5,0.9<wbr>75),
                        result$marginals.variance.nomi<wbr>nal[[1]])<br>
                        inla.qmarginal(c(0.025,0.5,0.9<wbr>75),
                        result$marginals.range.nominal<wbr>[[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='Den<wbr>sity')<br>
                        <br>
                        plot.default(inla.tmarginal(fu<wbr>nction(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.pre<wbr>dictor)<br>
                        <br>
                        linpred.mean <-
                        r.IEB$summary.linear.predictor<wbr>[index.pred,"mean"]<br>
                        linpred.2.5 <- r.IEB$summary.linear.predictor<wbr>[index.pred,"0.025quant"]<br>
                        linpred.10 <- r.IEB$summary.linear.predictor<wbr>[index.pred,"0.1quant"]<br>
                        linpred.50 <- r.IEB$summary.linear.predictor<wbr>[index.pred,"0.5quant"]<br>
                        linpred.97.5 <-
                        r.IEB$summary.linear.predictor<wbr>[index.pred,"0.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="m_-312923648872411721gmail_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 moz-do-not-send="true"
                            href="tel:+55%2019%2098238-5582"
                            value="+5519982385582" target="_blank">+55
                            19 982385582</a>  <br>
                          <span><span><a moz-do-not-send="true"
                                href="http://orcid.org/0000-0003-3426-308X"
                                target="_blank">http://orcid.org/0000-0003-<wbr>3426-308X</a><br>
                              <a moz-do-not-send="true"
                                href="https://github.com/wwolff7"
                                target="_blank">https://github.com/wwolff7</a><br>
                              <a moz-do-not-send="true"
href="http://buscatextual.cnpq.br/buscatextual/visualizacv.do?id=K4463141A1"
                                target="_blank">http://buscatextual.cnpq.br/<wbr>buscatextual/visualizacv.do?<wbr>id=K4463141A1</a></span></span></div>
                      </div>
                    </div>
                    <br>
                    <fieldset
                      class="m_-312923648872411721mimeAttachmentHeader"></fieldset>
                    <br>
                  </div>
                </div>
                <pre>______________________________<wbr>_________________
R-br mailing list
<a moz-do-not-send="true" class="m_-312923648872411721moz-txt-link-abbreviated" href="mailto:R-br@listas.c3sl.ufpr.br" target="_blank">R-br@listas.c3sl.ufpr.br</a>
<a moz-do-not-send="true" class="m_-312923648872411721moz-txt-link-freetext" href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br" target="_blank">https://listas.inf.ufpr.br/<wbr>cgi-bin/mailman/listinfo/r-br</a>
Leia o guia de postagem (<a moz-do-not-send="true" class="m_-312923648872411721moz-txt-link-freetext" href="http://www.leg.ufpr.br/r-br-guia" target="_blank">http://www.leg.ufpr.br/r-br-<wbr>guia</a>) e forne�a c�digo m�nimo reproduz�vel.</pre>
    </blockquote>
    

  </div>


______________________________<wbr>_________________

R-br mailing list

<a moz-do-not-send="true" href="mailto:R-br@listas.c3sl.ufpr.br">R-br@listas.c3sl.ufpr.br</a>

<a moz-do-not-send="true" href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br" rel="noreferrer" target="_blank">https://listas.inf.ufpr.br/<wbr>cgi-bin/mailman/listinfo/r-br</a>

Leia o guia de postagem (<a moz-do-not-send="true" href="http://www.leg.ufpr.br/r-br-guia" rel="noreferrer" target="_blank">http://www.leg.ufpr.br/r-br-<wbr>guia</a>) e forneça código mínimo reproduzível.
</blockquote></div>


-- 
<div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><span style="font-size:medium"><b><i>Wagner Wolff, </i></b></span><i><b>PhD</b></i>
"<b>Luiz de Queiroz</b><b><span>"</span> College of Agriculture,</b>
University of São Paulo
Pádua Dias avenue11 | 13418-900| Piracicaba-SP| Brazil
Phone:  <a moz-do-not-send="true" href="tel:+55%2019%2098238-5582" value="+5519982385582" target="_blank">+55 19 982385582</a>  
<span><span><a moz-do-not-send="true" href="http://orcid.org/0000-0003-3426-308X" target="_blank">http://orcid.org/0000-0003-3426-308X</a>
<a moz-do-not-send="true" href="https://github.com/wwolff7" target="_blank">https://github.com/wwolff7</a>
<a moz-do-not-send="true" 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>



</blockquote>
</body></html>