Published
Edited
Aug 19, 2021
Insert cell
Insert cell
Insert cell
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell
Insert cell
Insert cell
trials = 1000
Insert cell
howManyUII = 1 // 1 2 or 3
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell
q50 = 10
Insert cell
q90 = 11.5
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
aCoefsLow = pad16(thSIPS[0].aCoefficients) // TODO check values and do not reply on order of low-high
Insert cell
aCoefsHigh = pad16(thSIPS[1].aCoefficients)
Insert cell
Insert cell
Insert cell
Insert cell
me - 116.8014835 ///uuuugggh this doesn't tie to excel test. Need to debug yo()
Insert cell
me = yo(0.9153855721233413,newACoef) // Checking for match with excel! 116.8014835 uuugh. Hookup HDR once debugged
Insert cell
function yo(HDR, newACoefIn) {
let yo =
meanOfLogNormal *
(0 +
Math.exp(
// <-- suspect line??
newACoefIn[0] +
newACoefIn[1] * Math.log(HDR / (1 - HDR)) +
newACoefIn[2] * (HDR - 0.5) * Math.log(HDR / (1 - HDR)) +
newACoefIn[3] * (HDR - 0.5) +
Math.pow(newACoefIn[4] * (HDR - 0.5), 2) +
Math.pow(newACoefIn[5] * (HDR - 0.5), 2) * Math.log(HDR / (1 - HDR)) +
Math.pow(newACoefIn[6] * (HDR - 0.5), 3) +
Math.pow(newACoefIn[7] * (HDR - 0.5), 3) * Math.log(HDR / (1 - HDR)) +
Math.pow(newACoefIn[8] * (HDR - 0.5), 4) +
Math.pow(newACoefIn[9] * (HDR - 0.5), 4) * Math.log(HDR / (1 - HDR)) +
Math.pow(newACoefIn[10] * (HDR - 0.5), 5) +
Math.pow(newACoefIn[11] * (HDR - 0.5), 5) *
Math.log(HDR / (1 - HDR)) +
Math.pow(newACoefIn[12] * (HDR - 0.5), 6) +
Math.pow(newACoefIn[13] * (HDR - 0.5), 6) *
Math.log(HDR / (1 - HDR)) +
Math.pow(newACoefIn[14] * (HDR - 0.5), 7) +
Math.pow(newACoefIn[15] * (HDR - 0.5), 7) * Math.log(HDR / (1 - HDR))
));
return yo;
}

/* 'HDR Uniform RNG
#'
#'Creates a vector of uniform values ranging between 0 and 1 to be used in
#'conjunction with quantile functions to generate repeatable simulations.
#'Allows for the use of two values, "Var" and "Ent" to create repeatable
#'simulations across platforms.
#'
#'@param n The number of trials to be generated
#'@param Var Unique #ID for the simulation between 1 and 100,000,000
#'@param Ent A secondary optional unique ID between 1 and 100,000,000; defaults to 1000
#'@param Att1 A tertiary optional attribute ID between 1 and 100,000,000; defaults to 0
#'@param Att2 A quaternary optional attribute ID between 1 and 100,000,000; defaults to 0
#'@return A vector n length with psuedorandom uniform values between 0 and 1
=Mean_of_LogNormal*IFERROR(0+EXP(N6+N7*LN($D$23/(1-$D$23))+N8*($D$23-0.5)*LN($D$23/(1-$D$23))+N9*($D$23-0.5)+N10*($D$23-0.5)^2+N11*($D$23-0.5)^2*LN($D$23/(1-$D$23))+N12*($D$23-0.5)^3+N13*($D$23-0.5)^3*LN($D$23/(1-$D$23))+N14*($D$23-0.5)^4+N15*($D$23-0.5)^4*LN($D$23/(1-$D$23))+N16*($D$23-0.5)^5+N17*($D$23-0.5)^5*LN($D$23/(1-$D$23))+N18*($D$23-0.5)^6+N19*($D$23-0.5)^6*LN($D$23/(1-$D$23))+N20*($D$23-0.5)^7+N21*($D$23-0.5)^7*LN($D$23/(1-$D$23))), "" )
*/
Insert cell
thSIPS = getSIPs(howManyUII);
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more