0

I am mapping from

I need to map portfolio of assets to risk. My portfolio data is in binary format, i.e. the variable 0000001 denotes that I choose just the last asset for my portfolio. Now the dependent variable is the risk which is a scalar quantity.

I need to find a matrix A such that x.A.x = y where x and y are given to me, but x is a binary variable of length 26. When I try it using python, it gives me the error TypeError: expected 1D vector for x

As an example the vector x= 0100010100110101010101000101010101 gives me my portfolio selection, and corresponding to this selection, the risk comes out to be y = 0.00811, now similarly i have 10000 entries like this and the corresponding risk. I am working on linear/quadratic regression method to estimate matrix A such that x.A.x(transpose) = y.

Please can you suggest a way in Python to solve this issue.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.