Me desculpem, nao copiei tudo...<br>Como podem ver abaixo, já havia criado a matriz W.<br><br><br>set.seed(456)<br>w <- matrix(0, 1000, 1)<br>var <- 150<br>for (i in 1:1000)<br> {<br> w [i] <- rnorm * sqrt(varg)<br>
}<br><br>E mesmo assim ocorre o erro:<br><span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Arial;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium"><span style="font-family:'Lucida Console';font-size:16px;line-height:20px;text-align:-webkit-left;white-space:pre-wrap"><pre style="font-family:'Lucida Console';font-size:12pt !important;outline-style:none;outline-width:initial;outline-color:initial;border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:none;border-width:initial;border-color:initial;white-space:pre-wrap !important;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:1.3">
<span>Erro em W[j] <- 1 : objeto 'W' não encontrado</span></pre></span></span><br>