Commit 1e414588 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Estimation DLL: bugfixes in LogLikelihoodMain

parent 974e9ac0
......@@ -34,3 +34,14 @@ EstimatedParametersDescription::EstimatedParametersDescription(std::vector<Estim
{
}
size_t
EstimatedParametersDescription::getNumberOfPeriods() const
{
size_t r = 0;
for (size_t i = 0; i < estSubsamples.size(); i++)
{
size_t r2 = estSubsamples[i].endPeriod + 1;
if (r2 > r)
r = r2;
}
}
......@@ -49,6 +49,7 @@ public:
EstimatedParametersDescription(std::vector<EstimationSubsample> &estSubsamples, std::vector<EstimatedParameter> &estParams);
std::vector<EstimationSubsample> estSubsamples;
std::vector<EstimatedParameter> estParams;
size_t getNumberOfPeriods() const;
};
#endif // !defined(E8F2C096_A301_42e8_80FF_A643291BF995__INCLUDED_)
......@@ -53,7 +53,7 @@
* class LogPosteriorDensity on as needed basis and updates all parameters (inc. H
* and Q) when time slot xparam1 is supplied.
*
*
* Time indices follow C convention: first period has index 0.
*/
class EstimationSubsample {
public:
......
......@@ -34,8 +34,7 @@ LogLikelihoodMain::LogLikelihoodMain( //const Matrix &data_arg, Vector &deepPara
: estSubsamples(estiParDesc.estSubsamples),
logLikelihoodSubSample(dynamicDllFile, estiParDesc, n_endo, n_exo, zeta_fwrd_arg, zeta_back_arg, zeta_mixed_arg, zeta_static_arg, qz_criterium,
varobs, riccati_tol, lyapunov_tol, info_arg),
//deepParams(deepParams_arg),
vll(estSubsamples[estSubsamples.size()-1].endPeriod) // time dimension size of data
vll(estiParDesc.getNumberOfPeriods()) // time dimension size of data
{
......@@ -49,7 +48,7 @@ LogLikelihoodMain::~LogLikelihoodMain()
double
LogLikelihoodMain::compute(Matrix &steadyState, const Vector &estParams, Vector &deepParams, const MatrixConstView &data, Matrix &Q, Matrix &H, size_t start, int &info)
{
for (size_t i = 1; i <= (size_t) estSubsamples.size(); ++i)
for (size_t i = 0; i < estSubsamples.size(); ++i)
{
VectorView vSteadyState = mat::get_col(steadyState, i);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment