Random Normal Mixture vector input<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />Hi
I have been trying to write a formula for a column, using Random Normal Mixture(meanvec, sdvec, probvec). I would like to use Table variables as the input. How do I go about this? Do I define the table variables as vectors or can i make a vector of single table variables in the formula editor?
Thank you for any clues or help
Re: Random Normal Mixture vector inputThank you Ian... I was missing the Parse() function in there... Now I got it to work
Re: Random Normal Mixture vector inputI think Jim was just using the script above as a convenient way to generate the table with the required properties and formula. But the script is not required. Please see the attached.
Re: Random Normal Mixture vector inputHi Jim
Thank you very much for the answer. I was actually looking for a solution for how to do it in the formula editor in a table, ie. without scripting. Do you know how that can be done?
Best regards
Jeppe
Re: Random Normal Mixture vector inputHere is an example script that uses table variables as input to a Random Normal Mixture formula:
Names Default To Here( 1 );
dt = New Table( "Example" );
mv = [-3, 3];
sv = [1, 1];
pv = [.3, .7];
// All table variables are actually character strings
// so the matrices need to be saved as literals
dt << New Table Variable( "meanvec", Char( mv ) );
dt << New Table Variable( "sdvec", Char( sv ) );
dt << New Table Variable( "probvec", Char( pv ) );
dt << New Column( "Rand NM",
set formula( Random Normal Mixture(
Parse( dt:meanvec ),
Parse( dt:sdvec ),
Parse( dt:probvec ) ) )
);
dt << add rows( 1000 );