Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dóra Kocsis
dynare
Commits
db2615a4
Commit
db2615a4
authored
Nov 20, 2012
by
Stéphane Adjemian
Browse files
Use economy-size decomposition option of qr2 routine.
parent
af23d72c
Changes
3
Hide whitespace changes
Inline
Side-by-side
matlab/particle/fit_gaussian_mixture.m
View file @
db2615a4
...
...
@@ -22,7 +22,7 @@ for n=1:niters
diffs
=
bsxfun
(
@
minus
,
X
,
StateMu
(:,
j
));
tpost
=
(
1
/
sqrt
(
new_pr
(
j
)))
*
sqrt
(
posterior
(
j
,:));
diffs
=
bsxfun
(
@
times
,
diffs
,
tpost
);
[
foo
,
tcov
]
=
qr2
(
diffs
'
)
;
[
foo
,
tcov
]
=
qr2
(
diffs
'
,
0
);
StateSqrtP
(:,:,
j
)
=
tcov
'
;
if
check
if
min
(
abs
(
diag
(
StateSqrtP
(:,:,
j
))))
<
MIN_COVAR_SQRT
...
...
matlab/particle/gaussian_filter_bank.m
View file @
db2615a4
...
...
@@ -100,7 +100,7 @@ if strcmpi(DynareOptions.particle.IS_approximation_method,'cubature') || strcmpi
dObserved
=
bsxfun
(
@
minus
,
tmp
(
mf1
,:),
PredictedObservedMean
)
'.*
sqrt
(
weights
);
PredictedStateVarianceSquareRoot
=
chol
(
dState
'*dState)'
;
big_mat
=
[
dObserved
dState
;
[
H_lower_triangular_cholesky
zeros
(
number_of_observed_variables
,
number_of_state_variables
)]
]
;
[
mat1
,
mat
]
=
qr2
(
big_mat
)
;
[
mat1
,
mat
]
=
qr2
(
big_mat
,
0
)
;
mat
=
mat
'
;
clear
(
'mat1'
);
PredictedObservedVarianceSquareRoot
=
mat
(
1
:
number_of_observed_variables
,
1
:
number_of_observed_variables
)
;
...
...
matlab/particle/gaussian_mixture_filter_bank.m
View file @
db2615a4
...
...
@@ -107,7 +107,7 @@ if strcmpi(DynareOptions.particle.IS_approximation_method,'cubature')
dObserved
=
(
bsxfun
(
@
minus
,
tmp
(
mf1
,:),
PredictedObservedMean
)
'
)
.*
sqrt
(
weights3
);
PredictedStateVariance
=
dState
'*
dState
;
big_mat
=
[
dObserved
dState
;
[
H_lower_triangular_cholesky
zeros
(
number_of_observed_variables
,
number_of_state_variables
)]
]
;
[
mat1
,
mat
]
=
qr2
(
big_mat
)
;
[
mat1
,
mat
]
=
qr2
(
big_mat
,
0
)
;
mat
=
mat
'
;
clear
(
'mat1'
);
PredictedObservedVarianceSquareRoot
=
mat
(
1
:
number_of_observed_variables
,
1
:
number_of_observed_variables
)
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment