[R] Fwd: Quadratic programming, for loop
Spencer Graves
@pencer@gr@ve@ @end|ng |rom e||ect|vede|en@e@org
Tue Jun 26 17:00:53 CEST 2018
sos::findFn('{quadratic programming}') just identified 156 help
pages in 68 packages containing the term "quadratic programming". The
function mentioned by Berwin Turlach, "solve.QP", is in package
"quadprog", which has not been updated since 2016-12-20. I've used
qudprod successfully, but you might wish to consider some of the other
options in package(s) more actively maintained.
The "print" method for sos::findFn('{quadratic programming}')
produced two sheets in my default browser. The first of these contained
156 rows for the 156 help pages in 68 packages, sorted by default by
c('Count', 'MaxScore', 'TotalScore', 'Package', 'Score', 'Function').
The second sheet listed only the 68 packages sorted by c('Count',
'MaxScore', 'TotalScore', 'Package'). You can click on the column
headers to get them sorted in different orders, if you want.
"sos::findFn" is for me the fastest literature search for
anything statistical. I often write the list of help pages and the
package summary to an Excel file using the "writeFindFn2xls" function,
then annotate the package summary with other information to help me
decide which package(s) and function(s) to try.
Hope this helps.
Spencer Graves, lead author of "sos"
On 2018-06-26 07:01, Berwin A Turlach wrote:
> G'day all,
>
> On Tue, 26 Jun 2018 11:16:55 +0300
> Maija Sirkjärvi <maija.sirkjarvi using gmail.com> wrote:
>
>> It seems that my Amat and dvec are incompatible. Amat is a matrix of
>> zeros size: *2*J-3,J* and dvec is a vector of length *J*. There
>> should be no problem, but apparently there is. [...]
> solve.QP solves the quadratic program:
> min(-d^T b + 1/2 b^T D b)
> where A^T b >= b_0.
>
> Note the transpose. :)
> If dvec is of length *J*, then b will be of length J too, and Amat
> should be Jx(2J-3) so that its transpose is (2j-3)xJ, making it
> compatible for matrix multiplication with b.
>
> Cheers,
>
> Berwin
>
> ---
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list