solve.qp تتطلب d أن تكون متناظرة إيجابية محددة في r

StackOverflow https://stackoverflow.com/questions/3496882

  •  29-09-2019
  •  | 
  •  

سؤال

عندما أقوم بتشغيل solve.qp على مشكلتي ، أحصل على الخطأ التالي من R:

Error in solve.QP(sigma, rep(0, 5), t(Amat), bvec, meq = 2) : 
  matrix D in quadratic function is not positive definite!

مصفوفة سيجما الخاصة بي متماثلة ولكنها ليست إيجابية محددة. لماذا هذا مطلوب؟ إذا قمت بحلها بنفسي باستخدام وظائف Lagrangian ، فأنا قادر على الحصول على الحل. إذن لماذا يفرض R هذا المطلب؟

هل كانت مفيدة؟

المحلول

تبدأ خوارزمية Goldfarb-Idnani بحساب الحل غير المقيد. وبالتالي ، فإنه يتطلب أن تكون المصفوفة D في الوظيفة الموضوعية محددة.

مقتطفات من Fortran Source File Solve.qp.f:

c  this routine uses the Goldfarb/Idnani algorithm to solve the
c  following minimization problem:
c
c        minimize  -d^T x + 1/2 *  x^T D x
c        where   A1^T x  = b1
c                A2^T x >= b2
c
c  the matrix D is assumed to be positive definite.  Especially,
c  w.l.o.g. D is assumed to be symmetric.

نصائح أخرى

الوظيفة auglag في الحزمة alabama يوفر مضاعفات Lagrange في الحل لأي مشكلة تحسين.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top