Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
add support for individual probabilities in choice #211
current: test2: - threshold1: age / 200 - threshold2: threshold1 + 0.1 + 0.3 * work - u: uniform() - event: if(u < threshold1, 1, if(u < threshold2, 2, 3)) - show(groupby(age, work, event)) desired: test2: - prob1: age / 200 - prob2: 0.1 + 0.3 * work # list of arrays - event: choice([1, 2, 3], [prob1, prob2, 1 - prob1 - prob2]) # using a 2d array would make it easier in many cases (num_persons * num_choices) # e.g. # ARRAY is a 4d array, so the result is a 2d array (num_persons * num_choices) - agegroup_idx: trunc(agegroup / 5) - event: choice([1, 2, 3], ARRAY[gender * 1, workstate, agegroup_idx]) - show(groupby(age, work, event))
#117, would make this even nicer.
desired: test2: # using .points API as if we had LArray under the hood. - event: choice([1, 2, 3], ARRAY.points[gender, workstate, agegroup])