cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
peter_t
Level I

How does Random seed change when I click apply?

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? 

 

Here is an example script generating three random normal(0,1) numbers

NamesDefaultToHere(1);

Random Reset( 1234 );

dt=NewTable("test",
	AddRows(3),
	New Column( "X",
		Numeric,
		"Continuous",
		Formula( Random Normal( 0, 1 ) ),
	),
);

When running this script, I get the following random numbers

peter_t_0-1719208889863.png

And when I click Apply to the Formula, I get these new random numbers

peter_t_2-1719208946399.png

How does the random seed change when I click Apply? What seed would give me the three numbers above?

 

 

3 REPLIES 3
jthi
Super User

Re: How does Random seed change when I click apply?

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()).

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));
	)
);

(I think this will reset the seed to your number every time that formula is evaluated so it will for example affect other formulas).

 

This might have some extra information https://www.jmp.com/support/help/en/18.0/#page/jmp/random-functions.shtml

-Jarmo
peter_t
Level I

Re: How does Random seed change when I click apply?

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.

jthi
Super User

Re: How does Random seed change when I click apply?

Yeah, it does seem so.

I think you can get the "random state" using

Random Seed State();

function. So you could do some comparisons with that.

 

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).

-Jarmo