﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
664	Preconditioned simulation of BSR linear block	Víctor de Buen Remiro	Víctor de Buen Remiro	"In each iteration of BSR, we need to simulate vector [[LatexEquation(\beta $$)]] matching this linear constrained regression with ARIMA noise:

[[LatexEquation(Y = X \beta + z $$)]][[BR]]
[[LatexEquation(A \beta <= a $$)]][[BR]]
[[LatexEquation(\phi\left(B\right) z_t = \theta\left(B\right) e_t $$)]][[BR]]
[[LatexEquation(e \sim N\left(0,\sigma^{2} I\right) $$)]][[BR]]

ARMA and variance parameters are changing in each iteration of BSR, and, if there are missing values or non linear filters matrices [[LatexEquation(Y $$)]] and [[LatexEquation(X $$)]] could also change in each iteration. So, an ARIMA decomposition and filter and a Cholesky decomposition is needed in order to simulate linear block. Even if [[LatexEquation(X $$)]] is very sparse, after applying ARIMA filter it could become dense and process will be too slow.

I propose a preconditioning method to save a lot of time calculating and storing all blocks of a simulation only for one of K iterations and using them to generate aproximations that will be refinated in this fast way.

Let be the last full calculated and stored system

[[LatexEquation(Y' = X' \beta' + z' $$)]][[BR]]
[[LatexEquation(A \beta' <= a $$)]][[BR]]
[[LatexEquation(\phi'\left(B\right) z'_t = \theta'\left(B\right) e'_t $$)]][[BR]]
[[LatexEquation(e' \sim N\left(0,\sigma'^{2} I\right) $$)]][[BR]]

 1. Since this system has been previously decomposed is very fast to generate a vector [[LatexEquation(\beta' $$)]] matching it
 1. The corresponding ARIMA noise is simply [[BR]][[LatexEquation(z' = Y' - X' \beta' $$)]]
 1. By means of Almagro method it's posible to calculate residuals [[LatexEquation(e' $$)]] and initial values [[LatexEquation(u' $$)]] that solve difference equation [[BR]] [[LatexEquation(e'_t = \frac{\phi'\left(B\right)}{\theta'\left(B\right)} z'_t $$)]]
 1. Then we can purpose residuals and initial values for current system as [[BR]][[LatexEquation(e = \frac{\sigma}{\sigma'}e' $$)]] [[LatexEquation(u = \frac{\sigma}{\sigma'}u' $$)]]
 1. ARIMA noise for current system becomwes simply [[BR]][[LatexEquation(z_t = \frac{\theta\left(B\right)}{\phi\left(B\right)} e_t $$)]]
 1. Then, we can solve sparse linear system [[BR]][[LatexEquation(Y = X \beta + z $$)]]
 1. El vector resultante se aceptará si se cumplen las restricciones [[BR]] [[LatexEquation(A \beta <= a $$)]][[BR]] y de lo contrario se repite el proceso entero.

Cuando el número de repeticiones se hace insoportable se debe reemplazar el sistema almacenado.
"	enhancement	new	highest	Using OOP in BSR	Math	2.0.1	major		BSR, linear, ARIMA, preconditioned	
