cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
frankderuyck
Level VI

Add Random Seed to prediction formula

I would like make a reproducible simulation formula by adding a the same random number to a prediction formula .Guess this is possible with Random seed? I olnly find a very brief explanation in JMP help; how to add this random seed to a formula? 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Add Random Seed to prediction formula

If you can't add that random value column to the table which students are using, I think you could use Random Reset(Row()) (you can change the Row() to something else, but it should still be Row() dependent and not randomized, so Row()*Row() or Row() + 10 are for example fine).

jthi_0-1696784460942.png

jthi_1-1696784466191.png

Column 8 just demonstrates the random reset + random normal part

 

-Jarmo

View solution in original post

13 REPLIES 13
jthi
Super User

Re: Add Random Seed to prediction formula

I think you might be able to use Random Reset() 

-Jarmo
frankderuyck
Level VI

Re: Add Random Seed to prediction formula

What number should I put between the brackets?

frankderuyck
Level VI

Re: Add Random Seed to prediction formula

I added seed 1234 to a prediction formula for "Selectivity(%)"

frankderuyck_0-1696596438617.png

The result is that all the numbers in Selectivity column, for which I created the formula, become dots..

frankderuyck_1-1696596580090.png

 

jthi
Super User

Re: Add Random Seed to prediction formula

Random Reset will just set the seed, you will still need to use something else to add the number (number will be same for each of the rows due to having same seed)

jthi_0-1696598197719.png

 

-Jarmo
frankderuyck
Level VI

Re: Add Random Seed to prediction formula

Sorry I don't undestand, Random Lev? How to add a random number to my formula? 

jthi
Super User

Re: Add Random Seed to prediction formula

I have no idea what type of number you are adding, pick your number creation option and use that (there are a lot of those in JMP). One option is Random Integer().

Names Default To Here(1);

dt = New Table("Untitled",
	Add Rows(10),
	Compress File When Saved(1),
	New Column("Column 1",
		Numeric,
		"Continuous",
		Formula(Random Integer(1, 10))
	)
);

 Edit:

And if you wish to have same number on each of the rows (and not use Reset Seed()) As Constant should work (I think it is re-evaluated when formula is)

Names Default To Here(1);

dt = New Table("Untitled",
	Add Rows(10),
	Compress File When Saved(1),
	New Column("Column 1",
		Numeric,
		"Continuous",
		Formula(
			AsConstant(Random Integer(1, 10)))
	)
);
-Jarmo
Victor_G
Super User

Re: Add Random Seed to prediction formula

Hi @frankderuyck,

 

If I understand your need, you would like to create a Y response matching a specific model (with main effects, interactions, quadratic effects...), but adding some "controlled" noise so that you have a little variability in the response ? So that your response looks more realistic in the context of teaching and less completely deterministic with perfect modeling ?

 

In that case, the options mentioned by @jthi may help you, adding Random Normal or Random Integer in the response formula.
Here is a formula example I have used for a simulation : 

50 + :X3 * 10 + :X2 * 4 + :X2 * :X3 * 2 + :X2 * :X2 * -6 + Random Normal( 0, 2 )

I specified my Y response to have an intercept of 50, I added some terms in the model for thisresponse equation, and at the end, I added random normal noise, of mean 0 and standard deviation of 2.
Note that if I replay this Y column (open up, click on the formula without changing anything and then closing the window), numbers may change as the formula will be reevaluated. One option to avoid this is to check "Supress Eval", so that the formula will be fixed with the specified random normal noise :

Victor_G_0-1696613733316.png

 

If you talk about the modeling, you won't have any reproducibility issue using multivariate regression or some other models, but for some Machine Learning models, you have the option to specify the seed for analysis reproducibility (here an example of analyzing a Y response with Bootstap Forest specifying a random seed 12345 so that relaunching the analysis/script will give the exact same results) : 

Victor_G_1-1696613957663.png

 

I hope this answer will help you,

Victor GUILLER

"It is not unusual for a well-designed experiment to analyze itself" (Box, Hunter and Hunter)
frankderuyck
Level VI

Re: Add Random Seed to prediction formula

Dear @jthi and Victor, thanks for useful inputs, however think I need to better clarify my question. Teaching DOE I let students/trainees generate a DOE and to add the experimental results they have to copy column properties of a column with simulated results i.e. a formula + a random number. In order to make sure that analysis is reproducible the experimental results have to be the same for everyone in the class room. As an example I attached a file with a 3 factor CCD and a formula simulating the experimental Selectivity results of a chemical reaction. How to make sure that all three students 1, 2 and 3 get the same Selectity results when copying column properties of this formula? How to keep the random number fixed across all thee student columns? Hope this is suffi, iently clear now, thanks!

frankderuyck
Level VI

Re: Add Random Seed to prediction formula

forgot attachemnt..