Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dynare
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dynare
dynare
Commits
88858a1f
Commit
88858a1f
authored
9 years ago
by
Stéphane Adjemian
Browse files
Options
Downloads
Patches
Plain Diff
Cosmetic change.
Use logicals instead of 0/1.
parent
dc1df095
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
matlab/prior_draw.m
+15
-17
15 additions, 17 deletions
matlab/prior_draw.m
with
15 additions
and
17 deletions
matlab/prior_draw.m
+
15
−
17
View file @
88858a1f
function
pdraw
=
prior_draw
(
init
,
uniform
)
% --*-- Unitary tests --*--
% This function generate one draw from the joint prior distribution and
% allows sampling uniformly from the prior support (uniform==1 when called with init==1)
%
...
...
@@ -62,45 +63,45 @@ if nargin>0 && init
end
beta_index
=
find
(
prior_shape
==
1
);
if
isempty
(
beta_index
)
beta_draws
=
0
;
beta_draws
=
false
;
else
beta_draws
=
1
;
beta_draws
=
true
;
end
gamma_index
=
find
(
prior_shape
==
2
);
if
isempty
(
gamma_index
)
gamma_draws
=
0
;
gamma_draws
=
false
;
else
gamma_draws
=
1
;
gamma_draws
=
true
;
end
gaussian_index
=
find
(
prior_shape
==
3
);
if
isempty
(
gaussian_index
)
gaussian_draws
=
0
;
gaussian_draws
=
false
;
else
gaussian_draws
=
1
;
gaussian_draws
=
true
;
end
inverse_gamma_1_index
=
find
(
prior_shape
==
4
);
if
isempty
(
inverse_gamma_1_index
)
inverse_gamma_1_draws
=
0
;
inverse_gamma_1_draws
=
false
;
else
inverse_gamma_1_draws
=
1
;
inverse_gamma_1_draws
=
true
;
end
uniform_index
=
find
(
prior_shape
==
5
);
if
isempty
(
uniform_index
)
uniform_draws
=
0
;
uniform_draws
=
false
;
else
uniform_draws
=
1
;
uniform_draws
=
true
;
end
inverse_gamma_2_index
=
find
(
prior_shape
==
6
);
if
isempty
(
inverse_gamma_2_index
)
inverse_gamma_2_draws
=
0
;
inverse_gamma_2_draws
=
false
;
else
inverse_gamma_2_draws
=
1
;
inverse_gamma_2_draws
=
true
;
end
weibull_index
=
find
(
prior_shape
==
8
);
if
isempty
(
weibull_index
)
weibull_draws
=
0
;
weibull_draws
=
false
;
else
weibull_draws
=
1
;
weibull_draws
=
true
;
end
pdraw
=
NaN
(
number_of_estimated_parameters
,
1
);
return
...
...
@@ -173,9 +174,6 @@ if weibull_draws
end
end
%@test:1
%$ %% Initialize required structures
%$ options_.prior_trunc=0;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment