equivalent export function in yalmip matlab into picos python - picos-api

As I said, I am looking for the equivalent function into the library PICOS in python of the function export() from yalmip in matlab. Or how can I extract the matrices in normalised linear matrix form from an optimisation problem already written in PICOS python. Which are A, b
Thank you very much

Related

Optimize functions in C using Genetic Algorithms in R

I need to optimize some functions that are in the C language, but using genetic algorithms packages in R.
Is there any way to call C functions in R?
In matlab I know that there is this possibility through "mex". Is there something similar in R?
Yes, there is a way to call C functions in R. Have a look at .C() and .Call() and .External() and most of all at the Writing R Extensions manual.

Operations on long numbers in R

I aim to use maximum likelihood methods (usually about 10^5 iterations) with a probability distribution that creates very big integers and very small float values that cannot be stored as a numeric nor a in a float type.
I thought I would use the as.bigq in the gmp package. My issue is that one can only add, substract, multiply and dived two objects of class/type bigq, while my distribution actually contains logarithm, power, gamma and confluent hypergeometric functions.
What is my best option to deal with this issue?
Should I use another package?
Should I code all these functions for bigq objects.
Coding these function on R may cause some functions to be very slow, right?
How to write the logarithm function using only the +,-,*,/ operators? Should I approximate this function using a taylor series expansion?
How to write the power function using only the +,-,*,/ operators when the exponent is not an integer?
How to write the confluent hypergeometric function (the equivalent of the Hypergeometric1F1Regularized[..] function in Mathematica)?
I could eventually write these functions in C and call them from R but it sounds like some complicated work for not much, especially if I have to use the gmp package in C as well to handle these big numbers.
All your problems can be solved with Rmpfr most likely which allows you to use all of the functions returned by getGroupMembers("Math") with arbitrary accuracy.
Vignette: http://cran.r-project.org/web/packages/Rmpfr/vignettes/Rmpfr-pkg.pdf
Simple example of what it can do:
test <- mpfr(rnorm(100,mean=0,sd=.0001), 240)
Reduce("*", test)
I don't THINK it has hypergeometric functions though...

Matlab alternative function for ClustOfVar from R

I am working on clustering of variables in matlab. Two functions come in ClustOfVar package in R, called hcluster() and cutreevar().
I am good in Matlab and would like to use alternatives of hcluster() and cutreevar() in it.
Does Matlab has any inbuilt function which computes exactly same as hcluster() and cutreevar() does in R?
Need help.
Thanks
for heirarchical clustering you'll probably want to look at clusterdata. Note that you'll need the statistical toolbox for this function.

Linear programming using Matrices in R

I need to solve a linear program in R where the variables are matrices.
More specifically, my optimizing function looks like this.
Max X(A+B)Y - x - y,
where X,Y,A,B are matrices and x,y are scalars. Solve for X,Y,x,y
Subject to bunch of constraints like any linear program
Is there a way to solve this in R?
I checked out linprog and limsolve packages in R. They solve linear programs of scalars.
Is there a way to do the same for matrices in R.
Thanks for your help.
Googling for R linear programming matrices yielded a number of interesting links, of which the following might be interesting:
Simplex Method for Linear Programming Problems, for the boot package.

MATLAB's quadprog equivalent in R?

What is the equivalent of MATLAB's quadprog function in R in terms of function specification?
Note that it is not the R package quadprog (although the optimization procedure is the identical).
The R library quadprog uses the 'meq' argument to distinguish between equality and inequality constraints whereas MATLAB has separate arguments for these two. The MATLAB approach is far more convenient for my purposes.
It's not a big deal to transform my arguments to fit but it would be a nice convenience if there is an implementation in R that matches the specification in MATLAB.
Note:
MATLAB quadprog documentation
R quadprog documentation
If you can make the translation and you just want a more convenient function you'll have to make your own wrapper. There is no more similar solution in a package. Someone on here might do it for you but it sounds like you can do it yourself.

Resources