Uniform moving window, is it possible to boolean evaluate without adding a constraint?
Lets say I have a normal distribution y. I'd like to move a uniform distribution with two parameters mu and var to minimum the absolute error. The goal is to find the peak and variable of the distribution (well approximate it at least).
Here is an example:
data = np.random.normal(0,2,100)
y, bins = np.histogram(data,bins=100)
bins=bins[:-1]
mu=0
var=1
pdf = ((bins>=mu-var)&(bins<=mu+var))
obj = sum(y-pdf)
However, these variables do not support boolean assignment. Is this possible?
0
-
Official comment
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?.
Post is closed for comments.
Comments
1 comment