Open JamesSaxon opened 5 years ago
It looks like for the gaussian, you can just get the function from scipy directly.
from scipy.stats import norm
n1 = norm(scale = 1).pdf
n2(0)
https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.norm.html
For the step functions you could create something to generate the functions, like this:
d = {10 : 0.962, 20 : 0.704, 30 : 0.377, 60 : 0.042}
def step_fn(d):
step_limits = d
def F(v):
for lim in sorted(list(step_limits)):
if v <= lim:
return step_limits[lim]
return 0
return F
step_dict = step_fn(d)
step_dict(12)
Are the dictionaries for the step functions user-inputted? Or should there be some pre-defined dictionaries in place?
BTW, to clarify the general process for the way a weighting function is called.
For example,
stepwise_weight = HelperClass.step_fn(UserInputtedDictionary)
demand_df[NewColumn] = two_stage_fca(..., weight_fn = stepwise_weight)
Yes, they will be user-specified.