目的関数を次のように定義したいと思います。-sum(log(normcdf(x)))
ここでnormcdf
、の各コンポーネントで動作しますx
。実装されているようですが、Pythoncvxpy
にこだわりたいと思います。cvxopt
助言がありますか?
***** Example python code to make this question clearer:
from cvxopt import spmatrix, log
from cvxopt.modeling import variable, op, sum
# A is m x n matrix of type 'cvxopt.base.spmatrix' (not included here to save space)
# a_hat is n x 1 vector of type 'cvxopt.modeling.variable
a_hat = variable(n)
# constraints
c1 = (a_hat >= 0)
c2 = (a_hat <= 0)
#valid objective and optimization problem
f = -sum(A*a_hat)
op(f, [c1, c2]).solve()
# desired objective
# f = -sum(log( "cdf of each element of (A*a_hat)" ))
# this doesn't work either (because log 'argument must be a number of dense matrix')
# f = -sum(log(A*a_hat))