<font face="trebuchet ms,sans-serif">Veja o exemplo de como obter o gradiente e hessianos numericamente<br><br><span style="font-family:courier new,monospace">f <- function(beta, t){<br> with(as.list(beta),<br> b1/(1+b2*exp(-b3*t)))<br>
}<br><br>f(c(b1=1, b2=0.5, b3=-0.1), t=1:3)<br><br>require(rootSolve)<br><br>help(gradient, , help_type="html")<br>gradient(f, x=c(b1=1, b2=0.5, b3=-0.1), t=1)<br>gradient(f, x=c(b1=1, b2=0.5, b3=-0.1), t=1:3)<br>
<br>help(hessian, help_type="html")<br>hessian(f, x=c(b1=1, b2=0.5, b3=-0.1), t=1)<br>hessian(f, x=c(b1=1, b2=0.5, b3=-0.1), t=1:2)</span><br><br>Dependendo das operações que vai fazer, é melhor organizar o hessiano em um array.<br>
É possível obter analiticamente usando a deriv3(). Para isso veja esse post<br><br><a href="http://ridiculas.wordpress.com/2011/05/19/bandas-de-confianca-para-modelo-de-regressao-nao-linear/">http://ridiculas.wordpress.com/2011/05/19/bandas-de-confianca-para-modelo-de-regressao-nao-linear/</a><br>
<br>À disposição.<br>Walmes.<br><br clear="all"></font><span style="font-family:trebuchet ms,sans-serif">==========================================================================</span><br style="font-family:trebuchet ms,sans-serif">
<span style="font-family:trebuchet ms,sans-serif">Walmes Marques Zeviani</span><br style="font-family:trebuchet ms,sans-serif"><span style="font-family:trebuchet ms,sans-serif">LEG (Laboratório de Estatística e Geoinformação, 25.450418 S, 49.231759 W)</span><br style="font-family:trebuchet ms,sans-serif">
<span style="font-family:trebuchet ms,sans-serif">Departamento de Estatística - Universidade Federal do Paraná</span><br style="font-family:trebuchet ms,sans-serif"><span style="font-family:trebuchet ms,sans-serif">fone: (+55) 41 3361 3573</span><br style="font-family:trebuchet ms,sans-serif">
<span style="font-family:trebuchet ms,sans-serif">VoIP: (3361 3600) 1053 1173</span><br style="font-family:trebuchet ms,sans-serif"><span style="font-family:trebuchet ms,sans-serif">e-mail: <a href="mailto:walmes@ufpr.br" target="_blank">walmes@ufpr.br</a><br>
skype: walmeszeviani<br style="font-family:trebuchet ms,sans-serif"></span><span style="font-family:trebuchet ms,sans-serif">twitter: @walmeszeviani</span><br style="font-family:trebuchet ms,sans-serif"><span style="font-family:trebuchet ms,sans-serif">homepage: <a href="http://www.leg.ufpr.br/%7Ewalmes" target="_blank">http://www.leg.ufpr.br/~walmes</a></span><br style="font-family:trebuchet ms,sans-serif">
<span style="font-family:trebuchet ms,sans-serif">linux user number: 531218</span><br style="font-family:trebuchet ms,sans-serif"><span style="font-family:trebuchet ms,sans-serif">==========================================================================</span><br>