![]() Arguments to be passed to function.: fun: A string containing the name of the function to be minimized. I am not sure if I am framing the problem correctly or I'll have to use another function. x1,x2: Interval over which function is minimized.: P1,P2. ![]() But here, since my independent variable would be P, I would need a 2D array for my initial guess. The second argument in fmin_slsqp asks for a 1D ndarray x0 which is the initial guess for independent variable. Return (np.linalg.norm(np.dot(transpose(q),P)-transpose(q)))**2 I have defined this objective function which I am not sure is correct: def func(P, q): The objective function would be minimized w.r.t P where the constraints are:ฤก) all elements in P must be non-negative ![]() This is basically a markov process with q vectors as the probability of being in a state and P being the matrix of transition probabilities. I have the objective function as frobenius norm of |q0_T*P-q1_T| squared, where q0_T is the transpose of a nX1 vector and P is nXn matrix and q1_T is a transpose of a nX1 vector. I am trying to solve a linear least-squares problem using the fmin_slsqp function in scipy.optimize. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |