Exam Preparation Notes

Statistical Hypothesis Testing

  • H0H_0: Null hypothesis (default, uninteresting outcome).
  • H<em>1¬H</em>0H<em>1 \sim \neg H</em>0: Alternative hypothesis.
  • Process:
    1. Assume H0H_0.
    2. Under H0H_0, compute statistic of interest (e.g., QQ).
    3. Compare statistic with its distribution under H0H_0 (e.g., X2(df)X^2(\text{df})).
    • pp-value: Probability of observing QQ or something more extreme if H0H_0 was true.

P-Value and Significance Level

  • Probability Density Function (PDF): p=f<em>Q(Q</em>data)p = f<em>Q(Q</em>{\text{data}})
  • Cumulative Distribution Function (CDF): F<em>Q(Q</em>data)=<em>Q</em>datafQ(Q)dQF<em>Q(Q</em>{\text{data}}) = \int<em>{-\infty}^{Q</em>{\text{data}}} f_Q(Q) dQ
  • pp-value =1F<em>Q(Q</em>data)= 1 - F<em>Q(Q</em>{\text{data}})
  • Reject H0H_0 if p < \alpha (e.g., 0.05).
    • α\alpha: Probability of False Positives that we accept.

State-Space Identification

  • Motivation: Need "states" for control / fault detection / etc.
  • System representation:
    • Input: u(t)u(t)
    • Output: y(t)y(t)
    • State: x(t)x(t)
    • Equation: y(t)=G(q)u(t)y(t) = G(q) u(t)
  • Controller design (e.g., LQR - Linear Quadratic Regulator) uses state feedback.

Approaches to State-Space Modeling

  • App 1) Learn I/O model \rightarrow transform it to state space.
  • App 2) Learn state-space model directly.
  • State-space models are identifiable up to a change of coordinates of the state.

State-Space Model Equations

  • State equation: x(t+1)=Ax(t)+Bu(t)x(t+1) = Ax(t) + Bu(t)
  • Output equation: y(t)=Cx(t)+Du(t)y(t) = Cx(t) + Du(t)
  • Transfer function: G(z)=C(zIA)1B+DG(z) = C(zI - A)^{-1}B + D

Similarity Transformation

  • Change of coordinates: x~(t)=Px(t)\tilde{x}(t) = Px(t)
  • Transformed state equation: x~(t+1)=PAP1x~(t)+Bu(t)\tilde{x}(t+1) = PAP^{-1}\tilde{x}(t) + Bu(t)
  • Transformed output equation: y(t)=CP1x~(t)+Du(t)y(t) = CP^{-1}\tilde{x}(t) + Du(t)
  • Transfer function invariance: G(z)=C(zIA)1B+D=C~(zIA~)1B~+D~G(z) = C(zI - A)^{-1}B + D = \tilde{C}(zI - \tilde{A})^{-1}\tilde{B} + \tilde{D}

Extended Observability Matrix

  • Under similarity transformation:
    • A~=PAP1\tilde{A}=PAP^{-1}
    • B~=PB\tilde{B}=PB
    • C~=CP1\tilde{C}=CP^{-1}
    • D~=D\tilde{D}=D
  • Extended Observability Matrix changes under coordinates
    • O=[C CA CA2  CAr1]O = \begin{bmatrix} C \ CA \ CA^2 \ … \ CA^{r-1} \end{bmatrix}

Realization Theory

  • Goal: Given a learned I/O model, find a state-space representation.
  • Learned I/O model: y(t)=G(q;θ)u(t)y(t) = G(q; \theta)u(t)
  • G(q;θ)=b<em>0+b</em>1q1+b<em>2q2++b</em>mqm1+a<em>1q1+a</em>2q2++anqnG(q; \theta) = \frac{b<em>0 + b</em>1q^{-1} + b<em>2q^{-2} + … + b</em>mq^{-m}}{1 + a<em>1q^{-1} + a</em>2q^{-2} + … + a_nq^{-n}}
  • Objective: Solve G(q)=C(qIA)1B+DG(q) = C(qI - A)^{-1}B + D

Example: Controllable Canonical Form

  • G(q;θ)=b<em>0+b</em>1q1+b<em>2q2+b</em>3q31+a<em>1q1+a</em>2q2+a3q3G(q; \theta) = \frac{b<em>0 + b</em>1q^{-1} + b<em>2q^{-2} + b</em>3q^{-3}}{1 + a<em>1q^{-1} + a</em>2q^{-2} + a_3q^{-3}}
  • State equation:
    x(t+1)=[a<em>1a</em>2amp;a3 1amp;0amp;0 0amp;1amp;0]x(t)+[1 0 0]u(t)x(t+1) = \begin{bmatrix} -a<em>1 & -a</em>2 &amp; -a_3 \ 1 &amp; 0 &amp; 0 \ 0 &amp; 1 &amp; 0 \end{bmatrix} x(t) + \begin{bmatrix} 1 \ 0 \ 0 \end{bmatrix} u(t)
  • Output equation:
    y(t)=[b<em>1b</em>2amp;b<em>3]x(t)+[b</em>0]u(t)y(t) = \begin{bmatrix} b<em>1 & b</em>2 &amp; b<em>3 \end{bmatrix} x(t) + [b</em>0]u(t)

State Estimation: Kalman Filter

  • Optimal state estimator is the Kalman Filter.
  • State-space model:
    • State equation: x(t+1)=Ax(t)+Bu(t)+w(t)x(t+1) = Ax(t) + Bu(t) + w(t)
    • Output equation: y(t)=Cx(t)+Du(t)+v(t)y(t) = Cx(t) + Du(t) + v(t)
    • w(t)w(t): Process noise.
    • v(t)v(t): Measurement noise.
  • Rearrange output equation: Cx(t)=y(t)Du(t)v(t)Cx(t) = y(t) - Du(t) - v(t)

State Estimation Equations

  • y(t)=Cx(t)+Du(t)+v(t)y(t) = Cx(t) + Du(t) + v(t)
  • y(t+1)=C[Ax(t)+Bu(t)+w(t)]+Du(t+1)+v(t+1)=CAx(t)+CBu(t)+Du(t+1)+Cw(t)+v(t+1)y(t+1) = C[Ax(t) + Bu(t) + w(t)] + Du(t+1) + v(t+1) = CAx(t) + CBu(t) + Du(t+1) + Cw(t) + v(t+1)
  • Vector of outputs:
    [y(t) y(t+1) y(t+2)  y(t+r1)]=[C CA CA2  CAr1]x(t)+[Damp;0amp;0amp; CBamp;Damp;0amp; CABamp;CBamp;Damp; amp;amp;amp; CAr2Bamp;CAr3Bamp;CAr4Bamp;][u(t) u(t+1) u(t+2) ]+[v(t) w(t) w(t+1) ]\begin{bmatrix} y(t) \ y(t+1) \ y(t+2) \ … \ y(t+r-1) \end{bmatrix} = \begin{bmatrix} C \ CA \ CA^2 \ … \ CA^{r-1} \end{bmatrix} x(t) + \begin{bmatrix} D &amp; 0 &amp; 0 &amp; … \ CB &amp; D &amp; 0 &amp; … \ CAB &amp; CB &amp; D &amp; … \ … &amp; … &amp; … &amp; … \ CA^{r-2}B &amp; CA^{r-3}B &amp; CA^{r-4}B &amp; … \end{bmatrix} \begin{bmatrix} u(t) \ u(t+1) \ u(t+2) \ … \end{bmatrix} + \begin{bmatrix} v(t) \ w(t) \ w(t+1) \ … \end{bmatrix}

Re-arranging equations

  • Define:
    O<em>r=[C CA CA2  CAr1]O<em>r = \begin{bmatrix} C \ CA \ CA^2 \ … \ CA^{r-1} \end{bmatrix}S</em>r=[Damp;0amp;0amp; CBamp;Damp;0amp; CABamp;CBamp;Damp; amp;amp;amp; CAr2Bamp;CAr3Bamp;CAr4Bamp;]S</em>r = \begin{bmatrix} D &amp; 0 &amp; 0 &amp; … \ CB &amp; D &amp; 0 &amp; … \ CAB &amp; CB &amp; D &amp; … \ … &amp; … &amp; … &amp; … \ CA^{r-2}B &amp; CA^{r-3}B &amp; CA^{r-4}B &amp; … \end{bmatrix}
  • Rewrite: O<em>rx(t)=y</em>r(t)S<em>ru</em>r(t)vr(t)O<em>r x(t) = y</em>r(t) - S<em>r u</em>r(t) - v_r(t)
  • In theory: x(t)=O<em>r1(y</em>r(t)S<em>ru</em>r(t))x(t) = O<em>r^{-1} (y</em>r(t) - S<em>r u</em>r(t) )
  • But use Kalman Filter (KF) instead.

Solving Linear Equations

  • Ax=bAx = b: 3 possibilities
    1. Unique solution: A1bA^{-1}b, A is full column rank.
    2. 0 solutions: xx solves minAxb2min ||Ax - b||^2
    3. \infty solutions: xx solves minx2min ||x||^2 s.t. Ax=bAx = b

Kalman Filter Algorithm

  • State equation: x(t+1)=Ax(t)+Bu(t)+w(t)x(t+1) = Ax(t) + Bu(t) + w(t)
  • Output equation: y(t)=Cx(t)+Du(t)+v(t)y(t) = Cx(t) + Du(t) + v(t)
  • Initialization: x^00\hat{x}_{0|0}
  • Prediction:
    • x^<em>10=Ax^</em>00+Bu(0)\hat{x}<em>{1|0} = A \hat{x}</em>{0|0} + Bu(0)
  • Update:
    • x^<em>11=x^</em>10+K(y(1)Cx^10Du(0))\hat{x}<em>{1|1} = \hat{x}</em>{1|0} + K (y(1) - C \hat{x}_{1|0} - Du(0))
    • KK: Kalman Gain.
  • Output prediction error: y(1)Cx^10Du(0)y(1) - C \hat{x}_{1|0} - Du(0)
  • Next step prediction: x^<em>21=Ax^</em>11+Bu(1)\hat{x}<em>{2|1} = A \hat{x}</em>{1|1} + Bu(1)
  • Continue with update step