summaryrefslogtreecommitdiff
path: root/ccc2012/ccc2012.textile
diff options
context:
space:
mode:
authorJeff Armstrong <jeff@approximatrix.com>2012-10-13 09:13:29 -0400
committerJeff Armstrong <jeff@approximatrix.com>2012-10-13 09:13:29 -0400
commit5108d9ed4eb750e1f2afcbaa1f1a5d57aca91fd6 (patch)
treeecc800b969d529fc71f944f00a83807cb1ff26ab /ccc2012/ccc2012.textile
parent1e2ee6748232d2f2a7a1756bdea2588dd38e6ae0 (diff)
downloadpresentations-5108d9ed4eb750e1f2afcbaa1f1a5d57aca91fd6.tar.gz
presentations-5108d9ed4eb750e1f2afcbaa1f1a5d57aca91fd6.zip
Added DARE example
Diffstat (limited to 'ccc2012/ccc2012.textile')
-rw-r--r--ccc2012/ccc2012.textile20
1 files changed, 19 insertions, 1 deletions
diff --git a/ccc2012/ccc2012.textile b/ccc2012/ccc2012.textile
index 7875c29..9fcb1d9 100644
--- a/ccc2012/ccc2012.textile
+++ b/ccc2012/ccc2012.textile
@@ -231,7 +231,25 @@ p=. `X = A^T X A - ( A^T X B) (R + B^T X B)^-1 (B^T X A) + Q`
h1. Distrusting Others
{{{
-failed DARE...
+>>> from scipy import linalg
+>>> A
+array([[ 0.63399379, 0.54906824, 0.76253406],
+ [ 0.5404729 , 0.53745766, 0.08731853],
+ [ 0.27524045, 0.84922129, 0.4681622 ]])
+>>> B
+array([[ 0.96861695],
+ [ 0.05532739],
+ [ 0.78934047]])
+>>> Q
+array([[ 1., 0., 0.],
+ [ 0., 1., 0.],
+ [ 0., 0., 1.]])
+>>> R
+array([[ 1.]])
+>>> linalg.solve_discrete_are(A, B, Q, R)
+array([[-2.67522766, -5.39447418, 2.19128542],
+ [-1.94918951, -3.15480639, 5.24379117],
+ [ 4.29133973, 8.10585767, -5.88895897]])
}}}
* Lies!