Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi all,
wondering if someone can help on this.
I am trying to generate random values using NORMINV(RAND(),Mean,STD) where Mean and STD are values from another table.
to create 1000 random values I can use:
MonteCarlo:
Load
RecNo() AS Instance,
NORMINV(RAND(),5,2) AS [Assumption1]
AUTOGENERATE(1000); //where 5 and 2 are the mean and STD.
Now, how can I generate 1000 random values ([Assumption1]) for each ID in a resident table that looks as follow
ID, Mean, STD
1, 500,30
2,400,20
3,300,50
Just replace the INLINE table with your resident table:
LOAD
ID,
Iterno() as Instance,
NORMINV(RAND(),Mean,STD) as [Assumption1]
RESIDENT MeanSTD
WHILE iterno() <=1000;
LOAD
ID,
Iterno() as Instance,
NORMINV(RAND(),Mean,STD) as [Assumption1]
INLINE [
ID, Mean, STD
1, 500,30
2,400,20
3,300,50
]
WHILE iterno() <=1000;
Hi Swuehl,
I added the table as a sample of my original table which has about 300 lines.. so the inline load will not work. Any idea on how can i reference the table giving that the table name is MeanSTD..
Just replace the INLINE table with your resident table:
LOAD
ID,
Iterno() as Instance,
NORMINV(RAND(),Mean,STD) as [Assumption1]
RESIDENT MeanSTD
WHILE iterno() <=1000;