random number functions under TEMPORARY

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

random number functions under TEMPORARY

Kirill Orlov
I wonder what mechanics makes random number functions to produce
different result under TEMPORARY.
Compare:

set rng= mc seed= 494676727.
compute x= uniform(1).
print /x.
execute.
echo '----'.

set rng= mc seed= 494676727.
temporary.
compute x= uniform(1).
print /x.
execute.
echo '----'.


      .66
      .76
----
      .10
      .42
----

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: random number functions under TEMPORARY

Jon Peck
I don't know why the TEMPORARY sequence is different - maybe TEMPORARY is grabbing some random numbers from the generator - but I would recommend that you use the MT generator rather than MC as it has better randomization properties.  You can set the seed for that, but you cannot show the state, because the state is 64K long.

On Sun, Mar 28, 2021 at 6:58 AM Kirill Orlov <[hidden email]> wrote:
I wonder what mechanics makes random number functions to produce
different result under TEMPORARY.
Compare:

set rng= mc seed= 494676727.
compute x= uniform(1).
print /x.
execute.
echo '----'.

set rng= mc seed= 494676727.
temporary.
compute x= uniform(1).
print /x.
execute.
echo '----'.


      .66
      .76
----
      .10
      .42
----

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD


--
Jon K Peck
[hidden email]

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: random number functions under TEMPORARY

Kirill Orlov
MT generator does not change it, the behaviour under TEMPORARY.

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: random number functions under TEMPORARY

Kirill Orlov
In reply to this post by Jon Peck
It looks really strange. The presence of TEMPORARY should not affect
random number generation.

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: random number functions under TEMPORARY

Kirill Orlov
In reply to this post by Jon Peck
Maybe somebody from SPSS (besides Jon) will come to explain why it is so? The issue is interesting and quite important.


28.03.2021 20:23, Jon Peck пишет:
I don't know why the TEMPORARY sequence is different - maybe TEMPORARY is grabbing some random numbers from the generator - but I would recommend that you use the MT generator rather than MC as it has better randomization properties.  You can set the seed for that, but you cannot show the state, because the state is 64K long.

On Sun, Mar 28, 2021 at 6:58 AM Kirill Orlov <[hidden email]> wrote:
I wonder what mechanics makes random number functions to produce
different result under TEMPORARY.
Compare:

set rng= mc seed= 494676727.
compute x= uniform(1).
print /x.
execute.
echo '----'.

set rng= mc seed= 494676727.
temporary.
compute x= uniform(1).
print /x.
execute.
echo '----'.


      .66
      .76
----
      .10
      .42
----

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD