[Scilab-users] setting the seed of grand

Éric Dubois grocer.toolbox at gmail.com
Tue Jun 30 08:24:29 CEST 2015


If you want different draws for different k but the same i and j, yes the grand("setsd",S) should be outside the k loop.

By the way, help grand should have given you the answer to your request.

Éric

Envoyé de mon iPhone

> Le 30 juin 2015 à 02:45, fujimoto2005 <fujimoto2005 at gmail.com> a écrit :
> 
> Dear, Erick and Rafael
> 
> The actual script is like this.
> I want to exclude the effect of the different seed for the value of d(i,j,k)
> whit different i,j.
> 
> for i=1:100
>  for j=1:100
>     for k=1:100
>        grand("setsd",S")
>        x=grand(10,10,'norm',0,1)
>    y(i,j,k)=sum(mean(f(p1(i),p2(j),k,X)),'r'),'c')
>        ・・・・・
>     end
>  end
>  d(i,j,k)=(y(i,j,k)-y(i-1,j,k))/(p1(i)-p1(i-1))
> end
> 
> By the way, is the right position of 'the grand("setsd",S")' between 'for
> j=1:100' and 'for k=1:100'?
> 
> for j=1:100
>     grand("setsd",S")
>     for k=1:100
> 
> Before k-loop, there is a time consuming part independent of k-value .
> If k-loop is the most outside loop, time consuming part will be recalculated
> and I want to avoid that situation.
> 
> Best regards
> 
> 
> 
> --
> View this message in context: http://mailinglists.scilab.org/setting-the-seed-of-grand-tp4032520p4032523.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users



More information about the users mailing list