Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
matlab-gui
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
matlab-gui
Commits
6d4452b2
Verified
Commit
6d4452b2
authored
5 years ago
by
Houtan Bastani
Browse files
Options
Downloads
Patches
Plain Diff
use `assignin` instead of globals
parent
c01bcb09
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/gui_posterior_distribution.m
+6
-6
6 additions, 6 deletions
src/gui_posterior_distribution.m
with
6 additions
and
6 deletions
src/gui_posterior_distribution.m
+
6
−
6
View file @
6d4452b2
...
...
@@ -157,15 +157,14 @@ handles.pushbuttonSimulation = uicontrol( ...
function
pushbuttonPosterior_Callback
(
~
,
~
)
switch
handles
.
buttongroup
.
SelectedObject
.
String
case
'IRF'
global
posterior_irf
if
sum
([
handles
.
endoTable
.
Data
{:,
1
}])
~=
1
||
sum
([
handles
.
shocksTable
.
Data
{:,
1
}])
~=
1
gui_tools
.
show_error
(
'For IRF you must choose 1 endogenous and 1 exogenous variable'
);
end
posterior_irf
=
get_posterior_irf
(
...
handles
.
endoTable
.
Data
{[
handles
.
endoTable
.
Data
{:,
1
}],
2
},
...
handles
.
shocksTable
.
Data
{[
handles
.
shocksTable
.
Data
{:,
1
}],
2
});
assignin
(
'base'
,
'posterior_irf'
,
posterior_irf
);
case
'Covariance'
global
posterior_covariance
selected
=
handles
.
endoTable
.
Data
([
handles
.
endoTable
.
Data
{:,
1
}],
:);
switch
size
(
selected
,
1
)
case
1
...
...
@@ -175,34 +174,35 @@ handles.pushbuttonSimulation = uicontrol( ...
otherwise
gui_tools
.
show_error
(
'For Covariance you must choose 1 or 2 endogenous variables'
);
end
assignin
(
'base'
,
'posterior_covariance'
,
posterior_covariance
);
case
'Smoother'
if
sum
([
handles
.
endoTable
.
Data
{:,
1
}])
~=
1
gui_tools
.
show_error
(
'For Smoother you must choose 1 endogenous variable'
);
end
global
posterior_smoother
posterior_smoother
=
get_posterior_timeseries
(
'smoothed'
,
...
handles
.
endoTable
.
Data
{[
handles
.
endoTable
.
Data
{:,
1
}],
2
});
assignin
(
'base'
,
'posterior_smoother'
,
posterior_smoother
);
case
'Filter'
if
sum
([
handles
.
endoTable
.
Data
{:,
1
}])
~=
1
gui_tools
.
show_error
(
'For Filter you must choose 1 endogenous variable'
);
end
global
posterior_filter
posterior_filter
=
get_posterior_timeseries
(
'filtered'
,
...
handles
.
endoTable
.
Data
{[
handles
.
endoTable
.
Data
{:,
1
}],
2
});
assignin
(
'base'
,
'posterior_filter'
,
posterior_filter
);
case
'Update'
if
sum
([
handles
.
endoTable
.
Data
{:,
1
}])
~=
1
gui_tools
.
show_error
(
'For Update you must choose 1 endogenous variable'
);
end
global
posterior_update
posterior_update
=
get_posterior_timeseries
(
'updated'
,
...
handles
.
endoTable
.
Data
{[
handles
.
endoTable
.
Data
{:,
1
}],
2
});
assignin
(
'base'
,
'posterior_update'
,
posterior_update
);
case
'Forecast'
if
sum
([
handles
.
endoTable
.
Data
{:,
1
}])
~=
1
gui_tools
.
show_error
(
'For Forecast you must choose 1 endogenous variable'
);
end
global
posterior_forecast
posterior_forecast
=
get_posterior_timeseries
(
'forecast'
,
...
handles
.
endoTable
.
Data
{[
handles
.
endoTable
.
Data
{:,
1
}],
2
});
assignin
(
'base'
,
'posterior_forecast'
,
posterior_forecast
);
otherwise
gui_tools
.
show_error
(
'Should not arrive here'
);
end
...
...
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