Hi @ms ,
I have a related question (hence not another post) that I'm hoping your scripting method can help out with. It has to do with the post here. What I'm trying to do now is basically generalize what was put in the original post from a 4x4 correlation matrix to an arbitrary NxN matrix when "feeding" information to the Simulator in the profile.
From the other original post, there is script that can generate the NxN correlation matrix, and from your input, can generate a "prediction" column (the sum of the other N columns). Where I'm having a hard time is the following: when calling the Simulator() function, you have the following to pass it:
Simulator(state=0|1, <Factors(column << Random()|Fixed|(constant)|Expression()|Multivariate())>, <Responses(column)<<No Noise | Add Random Noise| Add Random Weighted Noise| Add Multivariate Noise), X Correlations ( state=0|1, {factor1, factor2, ..., factorN}, [NxN correlations]) >)
So, from the other original post, the solution to pass the correct list of factors ("tpListY") and correlation matrix ("corr.mat"), the JSL code needed to have the Eval Insert() wrapped around the call to send Simulator() to the Profiler report and then run an Eval(Parse()) around that.
The challenge now is how to correctly generalize this so that when calling Simulator() and defining the Factors, you can do this on that ColList.
ColList might be something like: ColList = {A, B, C, D, ...} and there is an associated mean and standard deviation for each column A, B, C, ....
What is the right syntax to call the Simulator so that it inserts the right mean and Std Dev for each factor? Example:
sim_design = Profiler(Y(:Pred), Invisible);
new = Eval Insert(
"sim_design << Simulator(
1,
Factors(
:A << mutlivariate(Mmean[1], MSD[1])),
:B << mutlivariate(Mmean[2], MSD[2])),
:C << mutlivariate(Mmean[3], MSD[3])), //etc. for the N columns in the made up table.
),
X Correlations(
1,
Eval(ColList),
Eval(corr_mat)
),
NRuns(1e6)
);");
Eval(Parse(new));
From the original data table, a second mock up is made with the number of columns (N) that were used to generate the correlation matrix (corr_mat). That mock up table is the one that sums the columns to make the :Pred column which is used as a dummy function to send to the Profiler. The variables Mmean and MSD are vectors that contain the mean and standard deviation of the N columns A through whatever.
Without having to explicitly write in each column and their corresponding mean, I'd like to have this more automated so that it can handle any number of columns.
What would be a good way to go about this?
I'm also having trouble with the Eval(corr_mat) actually entering the values of the correlation matrix in the X Correlations entries.
The attached data table and script should help to understand what I'm attempting.
Thanks!,
DS
Update, sorry added the wrong file, has correct data table now.