<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How does Random seed change when I click apply? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-does-Random-seed-change-when-I-click-apply/m-p/767789#M94804</link>
    <description>&lt;P&gt;Thanks for your reply. My problem is that it does not seem to be completely random because each time I run the above script and click Apply once, I will get exactly the same new "random" numbers. So to me it seems like the random seed is changed in a systematic way.&lt;/P&gt;</description>
    <pubDate>Mon, 24 Jun 2024 07:55:22 GMT</pubDate>
    <dc:creator>peter_t</dc:creator>
    <dc:date>2024-06-24T07:55:22Z</dc:date>
    <item>
      <title>How does Random seed change when I click apply?</title>
      <link>https://community.jmp.com/t5/Discussions/How-does-Random-seed-change-when-I-click-apply/m-p/767760#M94800</link>
      <description>&lt;P&gt;I use the Random Reset function to set a random seed in a simulation. How does the random seed change when I click Apply on the random formula?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is an example script generating three random normal(0,1) numbers&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;NamesDefaultToHere(1);

Random Reset( 1234 );

dt=NewTable("test",
	AddRows(3),
	New Column( "X",
		Numeric,
		"Continuous",
		Formula( Random Normal( 0, 1 ) ),
	),
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;When running this script, I get the following random numbers&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="peter_t_0-1719208889863.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/65507i71BDAE605E539DCD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="peter_t_0-1719208889863.png" alt="peter_t_0-1719208889863.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And when I click Apply to the Formula, I get these new random numbers&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="peter_t_2-1719208946399.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/65509i18E65FE3B329333C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="peter_t_2-1719208946399.png" alt="peter_t_2-1719208946399.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;How does the random seed change when I click Apply? What seed would give me the three numbers above?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2024 06:34:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-does-Random-seed-change-when-I-click-apply/m-p/767760#M94800</guid>
      <dc:creator>peter_t</dc:creator>
      <dc:date>2024-06-24T06:34:07Z</dc:date>
    </item>
    <item>
      <title>Re: How does Random seed change when I click apply?</title>
      <link>https://community.jmp.com/t5/Discussions/How-does-Random-seed-change-when-I-click-apply/m-p/767771#M94801</link>
      <description>&lt;P&gt;I would say it is random so you cannot really know which seed you have. If you have to always have same seed in a formula, I think you can use As Constant(Seed Reset()).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = New Table("test",
	AddRows(3),
	New Column("X", Numeric, "Continuous", Formula(
		As Constant(
			Random Reset(1234);
		);
		Random Normal(0, 1));
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;(I think this will reset the seed to your number every time that formula is evaluated so it will for example affect other formulas).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This might have some extra information &lt;A href="https://www.jmp.com/support/help/en/18.0/#page/jmp/random-functions.shtml" target="_blank"&gt;https://www.jmp.com/support/help/en/18.0/#page/jmp/random-functions.shtml&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2024 07:33:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-does-Random-seed-change-when-I-click-apply/m-p/767771#M94801</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-06-24T07:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: How does Random seed change when I click apply?</title>
      <link>https://community.jmp.com/t5/Discussions/How-does-Random-seed-change-when-I-click-apply/m-p/767789#M94804</link>
      <description>&lt;P&gt;Thanks for your reply. My problem is that it does not seem to be completely random because each time I run the above script and click Apply once, I will get exactly the same new "random" numbers. So to me it seems like the random seed is changed in a systematic way.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2024 07:55:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-does-Random-seed-change-when-I-click-apply/m-p/767789#M94804</guid>
      <dc:creator>peter_t</dc:creator>
      <dc:date>2024-06-24T07:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: How does Random seed change when I click apply?</title>
      <link>https://community.jmp.com/t5/Discussions/How-does-Random-seed-change-when-I-click-apply/m-p/767804#M94808</link>
      <description>&lt;P&gt;Yeah, it does seem so.&lt;/P&gt;
&lt;P&gt;I think you can get the "random state" using&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Random Seed State();&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;function. So you could do some comparisons with that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might want to contact JMP Support, they will then ask the developers, if needed and get back to you. Please post the "solution" or explanation from support back here, so we can all learn ("randomness" might be explained in some documentation for JMP but I have no idea where to find that).&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2024 08:55:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-does-Random-seed-change-when-I-click-apply/m-p/767804#M94808</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-06-24T08:55:31Z</dc:date>
    </item>
  </channel>
</rss>

