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
Mark Song
particles
Commits
af66ea9c
Commit
af66ea9c
authored
Jun 01, 2016
by
Stéphane Adjemian
Browse files
Changed logic for setting weights method in CPF.
parent
8c656316
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/conditional_filter_proposal.m
View file @
af66ea9c
...
...
@@ -105,7 +105,7 @@ if ParticleOptions.proposal_approximation.cubature || ParticleOptions.proposal_a
StateVectorVarianceSquareRoot
=
mat
(
number_of_observed_variables
+
(
1
:
number_of_state_variables
),
number_of_observed_variables
+
(
1
:
number_of_state_variables
));
Error
=
obs
-
PredictedObservedMean
;
StateVectorMean
=
PredictedStateMean
+
(
CovarianceObservedStateSquareRoot
/
PredictedObservedVarianceSquareRoot
)
*
Error
;
if
strcmpi
(
options_
.
particle
.
filter_algorithm
,
'cpf1'
)
if
options_
.
particle
.
cpf_weights_method
.
amisanotristani
Weights
=
SampleWeights
.*
probability2
(
zeros
(
number_of_observed_variables
,
1
),
PredictedObservedVarianceSquareRoot
,
Error
)
;
end
else
...
...
@@ -119,14 +119,14 @@ else
StateVectorMean
=
PredictedStateMean
+
KalmanFilterGain
*
Error
;
StateVectorVariance
=
PredictedStateVariance
-
KalmanFilterGain
*
PredictedObservedVariance
*
KalmanFilterGain
'
;
StateVectorVarianceSquareRoot
=
chol
(
StateVectorVariance
+
1e-6
)
'
;
if
strcmpi
(
options_
.
particle
.
filter_algorithm
,
'cpf1'
)
if
options_
.
particle
.
cpf_weights_method
.
amisanotristani
Weights
=
SampleWeights
.*
probability2
(
zeros
(
number_of_observed_variables
,
1
),
chol
(
PredictedObservedVariance
)
'
,
Error
)
;
end
end
PredictedStateVarianceSquareRoot
=
chol
(
PredictedStateVariance
+
1e-6
)
'
;
ProposalStateVector
=
StateVectorVarianceSquareRoot
*
randn
(
size
(
StateVectorVarianceSquareRoot
,
2
),
1
)
+
StateVectorMean
;
if
strcmpi
(
options_
.
particle
.
filter_algorithm
,
'cpf2'
)
if
options_
.
particle
.
cpf_weights_method
.
murrayjonesparslow
Prior
=
probability2
(
PredictedStateMean
,
PredictedStateVarianceSquareRoot
,
ProposalStateVector
)
;
Posterior
=
probability2
(
StateVectorMean
,
StateVectorVarianceSquareRoot
,
ProposalStateVector
)
;
Likelihood
=
probability2
(
obs
,
H_lower_triangular_cholesky
,
measurement_equations
(
ProposalStateVector
,
ReducedForm
,
ThreadsOptions
))
;
...
...
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