Closed spedygiorgio closed 9 years ago
What is the corresponding solnp function in c++ to solve the quadratic programming problem?
Hi Tae , use R package functions if not avoidable. I think that the R package that clickstreams author uses to perform QP problem is already in c++ so it suffices you To call it when necessary .
Best
Inviato da iPhone
Il giorno 17/ago/2015, alle ore 07:36, tskang notifications@github.com ha scritto:
What is the corresponding solnp function in c++ to solve the quadratic programming problem?
— Reply to this email directly or view it on GitHub.
I'm not sure what package you mean, but solnp which is used in clickstream is written in R, not c++. https://github.com/cran/Rsolnp/blob/master/R/solnp.R
So, I just implemented the fitting function in R. It returns the parameter lambda.
The following lines are tricky to convert to Rcpp as they involve environment to pass a function to solnp. environment(.fn1)=environment() Rsolnp::solnp(params, fun = .fn1, eqfun = .eqn1, eqB=1, LB=rep(0, order), control=list(trace=0))
I'm not sure how to do this in Rcpp.
It is done.
In general, there shoud be an S4 class containing the slots for the parameter, the name etc... Create a separate R file for the class (in R, use S4 and take inspiration from my markovchain s4 class), and a separate R file for the fit algorithm (in Rcpp).
have a look to http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.324.3297&rep=rep1&type=pdf and to clickstream package