%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% C_r_i = compute_reconstruction_correlation_matrix(Xi_i, Xi_res_i) % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FUNCTIONALITY: % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% This function aim is to compute the matrix that relates the variables % to use when reconstructing a faulty observation for a given fault % direction (Xi_i), using the projection of that fault direction in the % residual subspace (Xi_res_i). % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INPUT PARAMETERS: % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Xi_i: Column array or matrix with as many rows as variables were % used to build the PCA model and as many columns as individual % sensor faults are involved for the multisensory fault vector. % Xi_res_i: Projection of xi_i in the residual subspace of a PCA model. % It has the same dimensions as Xi_i. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% OUTPUT PARAMETERS: % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% C_r_i: Matrix that indicates the weight of each variable included to % build the PCA model when reconstructing using the fault % direction Xi_i (and its projection in the residual subspace % Xi_res_i). C_r_i is a square matrix with as many rows and % columns as variables where used to build the PCA model. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% We compute the the value of C_r_i for the fault direction Xi_i and its projection in the residual subspace Xi_res_i. The resulting value is subtracted from an identity matrix in order to have all variables affected by fault direction Xi_i have no influence on the reconstruction (their value are set to 0).
0001 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0002 % C_r_i = compute_reconstruction_correlation_matrix(Xi_i, Xi_res_i) % 0003 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0004 % FUNCTIONALITY: % 0005 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0006 % This function aim is to compute the matrix that relates the variables % 0007 % to use when reconstructing a faulty observation for a given fault % 0008 % direction (Xi_i), using the projection of that fault direction in the % 0009 % residual subspace (Xi_res_i). % 0010 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0011 % INPUT PARAMETERS: % 0012 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0013 % Xi_i: Column array or matrix with as many rows as variables were % 0014 % used to build the PCA model and as many columns as individual % 0015 % sensor faults are involved for the multisensory fault vector. % 0016 % Xi_res_i: Projection of xi_i in the residual subspace of a PCA model. % 0017 % It has the same dimensions as Xi_i. % 0018 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0019 % OUTPUT PARAMETERS: % 0020 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0021 % C_r_i: Matrix that indicates the weight of each variable included to % 0022 % build the PCA model when reconstructing using the fault % 0023 % direction Xi_i (and its projection in the residual subspace % 0024 % Xi_res_i). C_r_i is a square matrix with as many rows and % 0025 % columns as variables where used to build the PCA model. % 0026 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0027 function C_r_i = compute_reconstruction_correlation_matrix(Xi_i, Xi_res_i) 0028 % We compute the the value of C_r_i for the fault direction Xi_i and its 0029 % projection in the residual subspace Xi_res_i. The resulting value is 0030 % subtracted from an identity matrix in order to have all variables 0031 % affected by fault direction Xi_i have no influence on the reconstruction 0032 % (their value are set to 0). 0033 C_r_i = eye(size(Xi_i, 1)) - Xi_i * ((Xi_res_i' * Xi_res_i)\Xi_res_i');