Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ng) techniques. We will examine how to do this in Matlab shortly. We can write the Lagrangian equation in matrix form: such that and Where: denotes an vector; Matrix wikicour Stat841&pr intable= yes 63/74 10/09/2013 Stat841 - Wiki Cour se Notes and are vectors containing all 0s or all 1s respectively Using this matrix notation, we can use Matlab's built in quadratic programming routine, quadprog ( . Quadprog example Let's use q a p o to find the solution to udrg . Matlab's q a p o function minimizes an equation of the following form: udrg such that: , We can now see why we kept the and constant in the original derivation of the equation. The function is called as such: x = q a p o ( , , , , e , e , b u ) The variables correspond to values in the equation above. udrgHfAbAqbql,b. We can now try to find the solution to change how we call q a p o ). udrg (though, it should be noted, that in we subtract the first term rather than add it; I'm not sure if this difference would We'll use a simple one- dimensional data set, which is essentially y = - 1 or 1 + Gaussian noise. (Note: you could easily put the values straight into the quadprog equation; they are separated for clarity.) x=[vrd[1,00]10;mnn(1,00]10]; mnn(-][.1,0) vrd[.1,0)' y=[oe(0,) oe(0,); -ns101; ns101] S=(*) *(*) yx' yx; f=oe(0,) ns201; A=-ns120; oe(,0) b=0 ; Aq=y; e ' bq=0 e ; l =0 b ; u =[;%Teei n uprbud b hr s o pe on apa=qapo(,,,,e,e,bu) lh udrgSfAbAqbql,b; This gives us the optimal ... or at least I think it should, but it does not appear to work for me (that is, despite setting the lower boundary of 0, a number of values are still negative. Whether this is just the nature of q a p o or an error on my part is an exercise for the reader). udrg Examining K.K.T. conditions Karush- Kuhn- Tucker conditions ( (more info (
View Full Document

Ask a homework question - tutors are online