<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.3429" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial color=#0000ff>Oi pessoal, eu consegui rodar este exemplo
debaixo da distribuição multinomial</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>frames = 5<BR>for(i in 1:frames){<BR> # x =
seq(0, i, 1)<BR> f.3 =
rmultinom(30,3,prob=c(0.5,0.3,0.8))*dmultinom(x=1:3,prob=c(0.5,0.3,0.8))<BR> if
(i <= 5) {name = paste('000',i,'plot.jpeg',sep='')}<BR> #saves the plot
as a .jpeg file in the working
directory<BR> jpeg(name)<BR> contour(f.3, ylab ='probability',main =
paste('Multinomial density with n = ', i), col =
'red')<BR> dev.off()<BR>}</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Mas não consegui rodar este da normal, alguém sabe
como fazê-lo?</FONT></DIV>
<DIV><FONT face=Arial size=2>frames = 5<BR>for(i in 1:frames){<BR> x =
seq(0, i, 1)<BR> f.4 = rnorm(30)*dnorm(1)<BR> if (i <= 5) {name =
paste('000',i,'plot.jpeg',sep='')}<BR> #saves the plot as a .jpeg file in
the working directory<BR> jpeg(name)<BR>dens= density(f.4, ylab
='probability',main = paste('Normal density with n = ', i), col =
'red')<BR>points(dens,type='l',col=1)<BR># ou de preferência com o gráfico de
contorno</FONT></DIV>
<DIV><FONT face=Arial size=2> contour(f.4, ylab ='probability', main =
paste('Normal density with n = ', i), col =
'red')<BR>dev.off()<BR>}</FONT></DIV></BODY></HTML>