Reverts changes mistakenly added to commit f484942154
.
parent
f484942154
commit
fefccd4a1b
|
@ -110,8 +110,8 @@ extern "C" {
|
||||||
dr(pol, PartitionY(nstat, npred, nboth, nforw),
|
dr(pol, PartitionY(nstat, npred, nboth, nforw),
|
||||||
nexog, ConstVector{ysteady});
|
nexog, ConstVector{ysteady});
|
||||||
// form the shock realization
|
// form the shock realization
|
||||||
ConstTwoDMatrix shocks_mat(nexog, nper, ConstVector{shocks});
|
TwoDMatrix shocks_mat(nexog, nper, ConstVector{shocks});
|
||||||
ConstTwoDMatrix vcov_mat(nexog, nexog, ConstVector{vcov});
|
TwoDMatrix vcov_mat(nexog, nexog, ConstVector{vcov});
|
||||||
GenShockRealization sr(vcov_mat, shocks_mat, seed);
|
GenShockRealization sr(vcov_mat, shocks_mat, seed);
|
||||||
// simulate and copy the results
|
// simulate and copy the results
|
||||||
TwoDMatrix *res_mat
|
TwoDMatrix *res_mat
|
||||||
|
|
|
@ -560,7 +560,7 @@ RTSimulationWorker::operator()()
|
||||||
not work for semidefinite matrices. */
|
not work for semidefinite matrices. */
|
||||||
|
|
||||||
void
|
void
|
||||||
RandomShockRealization::choleskyFactor(const ConstTwoDMatrix &v)
|
RandomShockRealization::choleskyFactor(const TwoDMatrix &v)
|
||||||
{
|
{
|
||||||
factor = v;
|
factor = v;
|
||||||
lapack_int rows = factor.nrows();
|
lapack_int rows = factor.nrows();
|
||||||
|
@ -578,7 +578,7 @@ RandomShockRealization::choleskyFactor(const ConstTwoDMatrix &v)
|
||||||
decomposition. It works for semidifinite matrices. */
|
decomposition. It works for semidifinite matrices. */
|
||||||
|
|
||||||
void
|
void
|
||||||
RandomShockRealization::schurFactor(const ConstTwoDMatrix &v)
|
RandomShockRealization::schurFactor(const TwoDMatrix &v)
|
||||||
{
|
{
|
||||||
SymSchurDecomp ssd(v);
|
SymSchurDecomp ssd(v);
|
||||||
ssd.getFactor(factor);
|
ssd.getFactor(factor);
|
||||||
|
|
|
@ -990,7 +990,7 @@ protected:
|
||||||
MersenneTwister mtwister;
|
MersenneTwister mtwister;
|
||||||
TwoDMatrix factor;
|
TwoDMatrix factor;
|
||||||
public:
|
public:
|
||||||
RandomShockRealization(const ConstTwoDMatrix &v, unsigned int iseed)
|
RandomShockRealization(const TwoDMatrix &v, unsigned int iseed)
|
||||||
: mtwister(iseed), factor(v.nrows(), v.nrows())
|
: mtwister(iseed), factor(v.nrows(), v.nrows())
|
||||||
{
|
{
|
||||||
schurFactor(v);
|
schurFactor(v);
|
||||||
|
@ -1008,8 +1008,8 @@ public:
|
||||||
return factor.nrows();
|
return factor.nrows();
|
||||||
}
|
}
|
||||||
protected:
|
protected:
|
||||||
void choleskyFactor(const ConstTwoDMatrix &v);
|
void choleskyFactor(const TwoDMatrix &v);
|
||||||
void schurFactor(const ConstTwoDMatrix &v);
|
void schurFactor(const TwoDMatrix &v);
|
||||||
};
|
};
|
||||||
|
|
||||||
/* This is just a matrix of finite numbers. It can be constructed from
|
/* This is just a matrix of finite numbers. It can be constructed from
|
||||||
|
@ -1019,6 +1019,10 @@ class ExplicitShockRealization : virtual public ShockRealization
|
||||||
{
|
{
|
||||||
TwoDMatrix shocks;
|
TwoDMatrix shocks;
|
||||||
public:
|
public:
|
||||||
|
ExplicitShockRealization(const TwoDMatrix &sh)
|
||||||
|
: shocks(sh)
|
||||||
|
{
|
||||||
|
}
|
||||||
ExplicitShockRealization(const ConstTwoDMatrix &sh)
|
ExplicitShockRealization(const ConstTwoDMatrix &sh)
|
||||||
: shocks(sh)
|
: shocks(sh)
|
||||||
{
|
{
|
||||||
|
@ -1059,7 +1063,7 @@ public:
|
||||||
class GenShockRealization : public RandomShockRealization, public ExplicitShockRealization
|
class GenShockRealization : public RandomShockRealization, public ExplicitShockRealization
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GenShockRealization(const ConstTwoDMatrix &v, const ConstTwoDMatrix &sh, int seed)
|
GenShockRealization(const TwoDMatrix &v, const TwoDMatrix &sh, int seed)
|
||||||
: RandomShockRealization(v, seed), ExplicitShockRealization(sh)
|
: RandomShockRealization(v, seed), ExplicitShockRealization(sh)
|
||||||
{
|
{
|
||||||
KORD_RAISE_IF(sh.nrows() != v.nrows() || v.nrows() != v.ncols(),
|
KORD_RAISE_IF(sh.nrows() != v.nrows() || v.nrows() != v.ncols(),
|
||||||
|
|
|
@ -54,13 +54,6 @@ ConstTwoDMatrix::writeMat(mat_t *fd, const char *vname) const
|
||||||
delete[] data;
|
delete[] data;
|
||||||
}
|
}
|
||||||
|
|
||||||
TwoDMatrix &
|
|
||||||
TwoDMatrix::operator=(const ConstTwoDMatrix &m)
|
|
||||||
{
|
|
||||||
GeneralMatrix::operator=(m);
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
TwoDMatrix::copyRow(int from, int to)
|
TwoDMatrix::copyRow(int from, int to)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue