<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Oi Éder, <br>
    <br>
         É isso mesmo, estou calculando uma matriz mista média com
    correlação e probabilidade, agora estou tentando criar um matriz
    média:<br>
    <br>
    #Matriz média através na soma de todas as matrizes e divisão pelo
    número delas<br>
    RESmat<-NULL<br>
    for(i in 1:n_sim){<br>
    (RES[RES[,2]==i, 3:6]+RES[RES[,2]==i+1, 3:6])/length(n_sim)<br>
    }<br>
    <br>
          E depois vou comparar essa matriz média com a informação
    completa para a matriz de covariância por ML,<br>
    <br>
    Abraços,<br>
    <br>
    <pre class="moz-signature" cols="72">-- 
======================================================================
Alexandre dos Santos
Proteção Florestal 
IFMT - Instituto Federal de Educação, Ciência e Tecnologia de Mato Grosso
Campus Cáceres
Caixa Postal 244
Avenida dos Ramires, s/n
Bairro: Distrito Industrial 
Cáceres - MT                      CEP: 78.200-000
Fone: (+55) 65 8132-8112 (TIM)   (+55) 65 9686-6970 (VIVO)
<a class="moz-txt-link-abbreviated" href="mailto:e-mails:alexandresantosbr@yahoo.com.br">e-mails:alexandresantosbr@yahoo.com.br</a> 
        <a class="moz-txt-link-abbreviated" href="mailto:alexandre.santos@cas.ifmt.edu.br">alexandre.santos@cas.ifmt.edu.br</a> 
Lattes: <a class="moz-txt-link-freetext" href="http://lattes.cnpq.br/1360403201088680">http://lattes.cnpq.br/1360403201088680</a>
OrcID: orcid.org/0000-0001-8232-6722 
Researchgate: <a class="moz-txt-link-freetext" href="https://www.researchgate.net/profile/Alexandre_Santos10">https://www.researchgate.net/profile/Alexandre_Santos10</a>                       
LinkedIn: <a class="moz-txt-link-freetext" href="https://br.linkedin.com/in/alexandre-dos-santos-87961635">https://br.linkedin.com/in/alexandre-dos-santos-87961635</a>
======================================================================
</pre>
    <div class="moz-cite-prefix">Em 21/03/2016 15:52, Éder Comunello
      escreveu:<br>
    </div>
    <blockquote
cite="mid:CABmC8gkObiyFR7EferpvU0wV9z=9cxSrgttDrytTUhHBveF4FQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_default"
          style="font-family:verdana,sans-serif">Alexandre, boa tarde!</div>
        <div class="gmail_default"
          style="font-family:verdana,sans-serif"><br>
        </div>
        <div class="gmail_default"
          style="font-family:verdana,sans-serif">Só uma curiosidade... O
          resultado final que você deseja é realmente uma matriz mista
          (correlações e probalidades)?</div>
        <div class="gmail_extra"><br clear="all">
          <div>
            <div class="gmail_signature">
              <div dir="ltr">
                <div>
                  <div dir="ltr">
                    <div>
                      <div dir="ltr">
                        <div>
                          <div dir="ltr"><font style="font-size:small"
                              face="arial, helvetica, sans-serif">
                              <div style="font-family:'trebuchet
                                ms',sans-serif;display:inline">​</div>
                            </font><font style="font-size:12.8px"
                              face="arial, helvetica, sans-serif"><span
                                style="font-size:small">================================================</span><br>
                              Éder Comunello</font>
                            <div style="font-size:12.8px"><span
                                style="font-family:arial,helvetica,sans-serif">Agronomist
                                (UEM), MSc in Environ. Sciences (UEM)</span><font
                                face="arial, helvetica, sans-serif"><br>
                              </font></div>
                            <div style="font-size:12.8px">
                              <div style="font-size:small"><span
                                  style="font-family:arial,helvetica,sans-serif">DSc
                                  in Agricultural Systems
                                  Engineering (USP/Esalq)</span><br>
                              </div>
                              <div><span style="font-size:small">Brazilian
                                  Agricultural Research Corporation (</span><font
                                  style="font-size:small" face="arial,
                                  helvetica, sans-serif">Embrapa)</font></div>
                              <div>
                                <div><font style="font-size:small"
                                    face="arial, helvetica, sans-serif">Dourados,
                                    MS, Brazil </font><font size="2"
                                    face="arial, helvetica, sans-serif">|<O>|</font></div>
                                <div style="font-size:small"><span
                                    style="font-family:arial,helvetica,sans-serif">================================================</span><br>
                                </div>
                              </div>
                            </div>
                            <div style="font-size:small"><font
                                face="arial, helvetica, sans-serif">GEO, </font>-22.2752,
                              -54.8182, 408m<span
                                style="font-family:arial,helvetica,sans-serif"><br>
                              </span></div>
                            <div style="font-size:12.8px"><span
                                style="font-size:small;font-family:arial,helvetica,sans-serif">UTC-04:00
                                / DST: UTC-03:00</span></div>
                            <div>
                              <div>
                                <div><br>
                                </div>
                                <div><br>
                                </div>
                              </div>
                              <div style="font-size:small"><br>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <br>
          <div class="gmail_quote">Em 21 de março de 2016 11:02, ASANTOS
            <span dir="ltr"><<a moz-do-not-send="true"
                href="mailto:alexandresantosbr@yahoo.com.br"
                target="_blank">alexandresantosbr@yahoo.com.br</a>></span>
            escreveu:<br>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div bgcolor="#FFFFFF" text="#000000"> Muito obrigado
                Éder,<br>
                <br>
                      Foi muito útil sim, já estava largando mão,<br>
                <br>
                Redobrados agradecimentos,<br>
                <pre cols="72">-- 
======================================================================
Alexandre dos Santos
Proteção Florestal 
IFMT - Instituto Federal de Educação, Ciência e Tecnologia de Mato Grosso
Campus Cáceres
Caixa Postal 244
Avenida dos Ramires, s/n
Bairro: Distrito Industrial 
Cáceres - MT                      CEP: 78.200-000
Fone: <a moz-do-not-send="true" href="tel:%28%2B55%29%2065%208132-8112" value="+556581328112" target="_blank">(+55) 65 8132-8112</a> (TIM)   <a moz-do-not-send="true" href="tel:%28%2B55%29%2065%209686-6970" value="+556596866970" target="_blank">(+55) 65 9686-6970</a> (VIVO)
<a moz-do-not-send="true" href="mailto:e-mails:alexandresantosbr@yahoo.com.br" target="_blank">e-mails:alexandresantosbr@yahoo.com.br</a> 
        <a moz-do-not-send="true" href="mailto:alexandre.santos@cas.ifmt.edu.br" target="_blank">alexandre.santos@cas.ifmt.edu.br</a> 
Lattes: <a moz-do-not-send="true" href="http://lattes.cnpq.br/1360403201088680" target="_blank">http://lattes.cnpq.br/1360403201088680</a>
OrcID: <a moz-do-not-send="true" href="http://orcid.org/0000-0001-8232-6722" target="_blank">orcid.org/0000-0001-8232-6722</a> 
Researchgate: <a moz-do-not-send="true" href="https://www.researchgate.net/profile/Alexandre_Santos10" target="_blank">https://www.researchgate.net/profile/Alexandre_Santos10</a>                       
LinkedIn: <a moz-do-not-send="true" href="https://br.linkedin.com/in/alexandre-dos-santos-87961635" target="_blank">https://br.linkedin.com/in/alexandre-dos-santos-87961635</a>
======================================================================
</pre>
                <div>Em 21/03/2016 09:21, Éder Comunello escreveu:<br>
                </div>
                <blockquote type="cite">
                  <div dir="ltr">
                    <div style="font-family:verdana,sans-serif">Alexandre,
                      bom dia!</div>
                    <div style="font-family:verdana,sans-serif"><br>
                    </div>
                    <div style="font-family:verdana,sans-serif">Se ainda
                      lhe for útil, segue uma sugestão...</div>
                    <div style="font-family:verdana,sans-serif"><br>
                    </div>
                    <div>
                      <div><font face="monospace, monospace">###
                          <code r></font></div>
                      <div><font face="monospace, monospace">var1 <-
                          rnorm(200,5,0.25)</font></div>
                      <div><font face="monospace, monospace">var2 <-
                          1:500</font></div>
                      <div><font face="monospace, monospace">var3 <-
                          rnorm(100,5,0.25)</font></div>
                      <div><font face="monospace, monospace">var4 <-
                          500:1</font></div>
                      <div><font face="monospace, monospace"><br>
                        </font></div>
                      <div><font face="monospace, monospace">cor.prob
                          <- function(X){ <br>
                        </font></div>
                      <div><font face="monospace, monospace">     
                          pair.SampSize <- crossprod(!<a
                            moz-do-not-send="true" href="http://is.na"
                            target="_blank">is.na</a>(X)) </font></div>
                      <div><font face="monospace, monospace">     
                          above1 <- row(pair.SampSize) <
                          col(pair.SampSize) </font></div>
                      <div><font face="monospace, monospace">     
                          pair.df <- pair.SampSize[above1] - 2 </font></div>
                      <div><font face="monospace, monospace"><br>
                        </font></div>
                      <div><font face="monospace, monospace">      R
                          <- cor(X, use="pair") </font></div>
                      <div><font face="monospace, monospace">     
                          above2 <- row(R) < col(R) </font></div>
                      <div><font face="monospace, monospace">      r2
                          <- R[above2]^2 </font></div>
                      <div><font face="monospace, monospace">      Fstat
                          <- (r2 * pair.df)/(1 - r2) </font></div>
                      <div><font face="monospace, monospace">     
                          R[above2] <- 1 - pf(Fstat, 1, pair.df) </font></div>
                      <div><font face="monospace, monospace">      R </font></div>
                      <div><font face="monospace, monospace">      } </font></div>
                      <div><font face="monospace, monospace"><br>
                        </font></div>
                      <div><font face="monospace, monospace">tam   <-
                          100 # amostra <br>
                        </font></div>
                      <div><font face="monospace, monospace">n_sim <-
                           99 # simulações </font></div>
                      <div><font face="monospace, monospace"><br>
                        </font></div>
                      <div><font face="monospace, monospace">RES <-
                          NULL <br>
                        </font></div>
                      <div><font face="monospace, monospace">for(i in
                          1:n_sim){</font></div>
                      <div><font face="monospace, monospace">     dados
                            <- sapply(c("var1", "var2", "var3",
                          "var4"), function(x) sample(get(x), 100))</font></div>
                      <div><font face="monospace, monospace">   
                           correla <- round(cor.prob(dados),4) </font></div>
                      <div><font face="monospace, monospace">     res  
                            <- cbind(i, correla) </font></div>
                      <div><font face="monospace, monospace">     RES  
                            <- rbind(RES, res) </font></div>
                      <div><font face="monospace, monospace">} </font></div>
                      <div><font face="monospace, monospace"># </font></div>
                      <div><font face="monospace, monospace"><br>
                        </font></div>
                      <div><font face="monospace, monospace">RES[c(1:5,392:396),]</font></div>
                      <div><font face="monospace, monospace">#       i  
                           var1    var2    var3   var4</font></div>
                      <div><font face="monospace, monospace"># var1  1
                           1.0000  0.8025  0.8451 0.9178</font></div>
                      <div><font face="monospace, monospace"># var2  1
                          -0.0253  1.0000  0.6609 0.0106</font></div>
                      <div><font face="monospace, monospace"># var3  1
                          -0.0198  0.0444  1.0000 0.4850</font></div>
                      <div><font face="monospace, monospace"># var4  1
                          -0.0104 -0.2545 -0.0706 1.0000</font></div>
                      <div><font face="monospace, monospace"># var1  2
                           1.0000  0.5200  0.1704 0.8461</font></div>
                      <div><font face="monospace, monospace"># var4 98
                           0.1309  0.0332 -0.1361 1.0000</font></div>
                      <div><font face="monospace, monospace"># var1 99
                           1.0000  0.1433  0.2047 0.3260</font></div>
                      <div><font face="monospace, monospace"># var2 99
                          -0.1474  1.0000  0.5391 0.9524</font></div>
                      <div><font face="monospace, monospace"># var3 99
                          -0.1279 -0.0621  1.0000 0.2885</font></div>
                      <div><font face="monospace, monospace"># var4 99
                          -0.0992 -0.0060  0.1072 1.0000</font></div>
                      <div><font face="monospace, monospace">###
                          </code></font></div>
                      <div><font face="verdana, sans-serif"><br>
                        </font></div>
                      <div style="font-family:verdana,sans-serif"><br>
                      </div>
                    </div>
                    <div class="gmail_extra"><br clear="all">
                      <div>
                        <div>
                          <div dir="ltr">
                            <div>
                              <div dir="ltr">
                                <div>
                                  <div dir="ltr">
                                    <div>
                                      <div dir="ltr"><font
                                          style="font-size:small"
                                          face="arial, helvetica,
                                          sans-serif">
                                          <div>​</div>
                                        </font><font
                                          style="font-size:12.8px"
                                          face="arial, helvetica,
                                          sans-serif"><span
                                            style="font-size:small">================================================</span><br>
                                          Éder Comunello</font>
                                        <div style="font-size:12.8px"><span
style="font-family:arial,helvetica,sans-serif">Agronomist (UEM), MSc in
                                            Environ. Sciences (UEM)</span><font
                                            face="arial, helvetica,
                                            sans-serif"><br>
                                          </font></div>
                                        <div style="font-size:12.8px">
                                          <div style="font-size:small"><span
style="font-family:arial,helvetica,sans-serif">DSc in Agricultural
                                              Systems
                                              Engineering (USP/Esalq)</span><br>
                                          </div>
                                          <div><span
                                              style="font-size:small">Brazilian

                                              Agricultural Research
                                              Corporation (</span><font
                                              style="font-size:small"
                                              face="arial, helvetica,
                                              sans-serif">Embrapa)</font></div>
                                          <div>
                                            <div><font
                                                style="font-size:small"
                                                face="arial, helvetica,
                                                sans-serif">Dourados,
                                                MS, Brazil </font><font
                                                size="2" face="arial,
                                                helvetica, sans-serif">|<O>|</font></div>
                                            <div style="font-size:small"><span
style="font-family:arial,helvetica,sans-serif">================================================</span><br>
                                            </div>
                                          </div>
                                        </div>
                                        <div style="font-size:small"><font
                                            face="arial, helvetica,
                                            sans-serif">GEO, </font>-22.2752,

                                          -54.8182, 408m<span
                                            style="font-family:arial,helvetica,sans-serif"><br>
                                          </span></div>
                                        <div style="font-size:12.8px"><span
style="font-size:small;font-family:arial,helvetica,sans-serif">UTC-04:00
                                            / DST: UTC-03:00</span></div>
                                        <div>
                                          <div>
                                            <div><br>
                                            </div>
                                            <div><br>
                                            </div>
                                          </div>
                                          <div style="font-size:small"><br>
                                          </div>
                                        </div>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                  <br>
                  <fieldset></fieldset>
                  <br>
                  <pre>_______________________________________________
R-br mailing list
<a moz-do-not-send="true" href="mailto:R-br@listas.c3sl.ufpr.br" target="_blank">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" target="_blank">https://listas.inf.ufpr.br/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" target="_blank">http://www.leg.ufpr.br/r-br-guia</a>) e forne�a c�digo m�nimo reproduz�vel.</pre>
                </blockquote>
                <br>
              </div>
            </blockquote>
          </div>
          <br>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>