﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
798	Fallo en la estimación de BSR	imendez	Víctor de Buen Remiro	"Hola, tengo un problema con BSR, a ver si me podéis ayudar a encontrar el fallo.
Tengo una estimación con 240 parámetros lineales, 37 hiperparámetros, 3 parámetros ARMA y 28 omitidos:

{{{
[BysMcmc::DefineBlock] Block (1) BSR.MainLinBlock.Modelo_CEN02 of size 277
[BysMcmc::DefineBlock] Block (2) BSR.SigmaBlock.Modelo_CEN02 of size 1
[BSR.ArimaBlock.Modelo_CEN02]  Initializing block
  [BSR.ArimaBlock.Modelo_CEN02]  Original data length = 3726
  [BSR.ArimaBlock.Modelo_CEN02]  Differenced data length = 3719
  [BSR.ArimaBlock.Modelo_CEN02]  ARMA parameters = 3
[BysMcmc::DefineBlock] Block (3) BSR.ArimaBlock.Modelo_CEN02 of size 3
[BysMcmc::DefineBlock] Block (4) BSR.InputMissingBlock.Modelo_CEN02 of size 0
[BysMcmc::DefineBlock] Block (5) BSR.OutputMissingBlock.Modelo_CEN02 of size 28
}}}

Me da el siguiente error:

{{{
CHOLMOD warning: matrix not positive definite
Warning: [372] [CHOLMOD 1] at line c:\users\jsperez\suitesparse\cholmod\supernodal\t_cholmod_super_numeric.c:614: matrix not positive definite
ERROR: [1] No es posible aplicar CholeskiFactor a una matriz virtual no definida positiva  Cholmod.R.Sparse(277x277)
}}}

Por el error creo que se debe a que hay una combinación lineal, pero no hay ningún Warning previo que indique eso. Es más, si estimo sin jerarquías todo funciona aparentemente bien, aunque da el siguiente Warning que no sé si tiene algo que ver:

{{{
Simulating iterations   201-  300 [done  18.27%] [time/sim: 0.135625 s] [remaining    122 s]
Warning: [372] [BSR.MainLinBlock.Modelo_CEN02] Cholesky solving had rounding error in interval [5.784e-012,1.432454155292362e-011 for 22 times of 300
 Simulating iterations   301-  400 [done  27.36%] [time/sim: 0.134219 s] [remaining    107 s]
}}}

Si a alguien se le ocurre alguna pista de qué puedo estar haciendo me vendrá muy bien, porque estoy bastante perdido.
Adjunto dos archivos por si os ayudan: el "".bsr"" para poder reproducir la estimación, y el "".oza"" con la matriz fallida (Failed factorization matrix).

Los parámetros de conifguración de BSR utilizados son:

{{{
NameBlock bsr.config =
[[
//MCMC dimensions
  Real mcmc.burnin       =  100;//100;//2000
  Real mcmc.sampleLength =  1000;//500;//10000
  Real mcmc.cacheLength  =  100;
//Basic master configuration
  Real basic.cholesky.epsilon          = 1.E-13;
  Real basic.cholesky.warningFreq      = 100;
  Real basic.truncMNormal.gibbsNumIter = 5;
//Report configuration
  Real report.raftery.diag.q   = 0.025;
  Real report.raftery.diag.r   = 0.007;   
  Real report.raftery.diag.s   = 0.950;   
  Real report.raftery.diag.eps = 0.001; 
  Real report.acf.lag          = 20,
  Real report.histogram.parts  = 100;
  Real report.kerDens.points   = 0;
  Real report.kerDens.numIter  = 2;
  Real report.kerDens.epsilon  = 0.001;
//If it is true the automatic generated input missing variables will use 
//id_node as prefix of identifier.
  Real DBApi.useNodeInMissingIdentifier = True;
//Use Metropolis-Hastings instead og Gibbs for linear blocks after
//this number of iterations
  Real bsr.linBlk.MH.useAfterIter   = 10;
//Use Gibbs method after these rejections of Metropolis-Hastings
  Real bsr.linBlk.MH.maxRejected    = 2;
//Use Gibbs method after these consecutive iterations of Metropolis-Hastings
  Real bsr.linBlk.MH.maxConsecutive = 10; 
//Generic flags
  Real do.resume               = False;
  Real do.report               = True;
  Real do.eval                 = True;
  Real do.linear.effects       = True;
  Real do.save.DBApi.Estim.Oza = False;
//Metodo de aproximacion del arima
  Text bsr.arimaFilter   = BysMcmc::Options::Arima.Filter::FastCholSea;
  Real bsr.arimaSkipIter = 10//mcmc.burnin + mcmc.sampleLength + 1
]];
}}}

Gracias de antemano.
"	doubt	closed	highest	BSR API	Math	1.1.7	major	fixed		
