Am 24.07.2024 um 23:03 schrieb Sven Schreiber:
Am 24.07.2024 um 22:45 schrieb Cottrell, Allin:
On Wed, Jul 24, 2024 at 4:22 PM Sven Schreiber
<sven.schrei...@fu-berlin.de> wrote:
I don't have time to give a minimal example right now, but I could do so
on Friday or so, if necessary.
Please do. This may be redundant, but of course the "no_const"
specification only applies to GUI usage.
Will do, and yes, GUI context.
OK, I'm attaching a stripped-down package version for testing. I'm
observing various problems:
- The package specifies "no-data-ok" and this also shows up in the info.
However, when executing the package GUI, a warning dialog with "this
requires a dataset" appears.
- The GUI_SVAR_setID_uimaker function is declared as the ui-maker, and
requests no_const both for the lists X and Y, as well as no_singleton
for Y. However, in the GUI I can execute the package under all those
cases that are supposed to be prevented.
All this is with the recent GTK3 snapshot on Windows.
thanks
sven
<?xml version="1.0" encoding="UTF-8"?>
<gretl-functions>
<gretl-function-package name="SVAR_setID_GUI" no-data-ok="true" minver="2023c">
<author email="sven.schrei...@fu-berlin.de">Sven Schreiber</author>
<version>0.101</version>
<date>2024-07-26</date>
<description>no_const test case</description>
<tags>C32</tags>
<label>no_const test case</label>
<help filename="SVAR_setID_GUI_help.md">
# Provisional help for SVAR_setID_GUI
This function package belongs to the SVAR addon for gretl and is a separate
package only for internal technical reasons. Its only purpose is to provide
a graphical (GUI) access to SVAR's functionality regarding set-identified
(set-ID'ed) models. In particular, this GUI tool only supports pure sign
restrictions and optionally exact zero restrictions (impact only for the
latter).
Normally you should not need (or want) to call this function in a script.
For further descriptions of the arguments and their meanings please see the
extensive documentation of the SVAR addon, especially of course the chapter
8 about set identification therein.
The scripting interface offers more functionality and flexibility and is
recommended for more than exploratory work.
A SVAR version 2024c or more recent is strongly recommended.
Help text to be completed...
## Changelog:
v0.1 (July 2024):
- initial prototype
</help>
<depends count="1">
SVAR </depends>
<provider>SVAR</provider>
<gretl-function name="GUI_SVAR_setID" type="bundle" pkg-role="gui-main">
<params count="2">
<param name="Y" type="list" const="true">
<description>VAR variables</description>
</param>
<param name="X" type="list" optional="true">
<description>exogenous regressors</description>
</param>
</params>
<code>bundle m = _()
return m
</code>
</gretl-function>
<gretl-function name="GUI_SVAR_setID_uimaker" type="bundle" private="1" pkg-role="ui-maker">
<code>bundle ui
# about list params
ui.Y = _(no_singleton=1, no_const=1)
ui.X = _(no_const=1) # deterministics are handled separately
return ui
</code>
</gretl-function>
<sample-script>
# SVAR_setID_GUI_sample.inp
/*
This sample script only exists because it is required for a function
package. The function is not meant for scripting. If you want to perform
SVAR set-id analysis by scripting, please use the relevant functions in
the SVAR addon directly. The SVAR pdf help also contains a chapter about
the set-identification case.
*/
include SVAR_setID_GUI.gfn
### supply & demand (artificial example)
# based on supply_demand.inp in examples/SetRestrictions
nulldata 240
setobs 12 1:1
b = -0.8 # demand elasticity
c = 1.1 # supply elasticity
# simulate data via the reduced form
Gamma = {1, -c; -b, 1}
iG = inv(Gamma)
U = 3 + filter(mnormal($nobs, 2), 1, 0.8)
mY = U * iG'
series p = mY[,1]
series q = mY[,2]
list Y = p q
order = 1
horizon = 12
shocknames = "Supply Demand"
matrix Restrictions = {-1; +1} # supply shock brings price down and quantity up
Restrictions ~= {+1; +1} # demand shock raises price as well as quantity
# matrix starts # left at default 0
# matrix ends # left at default max horizon -- maybe too much
myb = GUI_SVAR_setID(Y, const, FALSE, order,horizon, Restrictions, null, null, shocknames)
</sample-script>
</gretl-function-package>
</gretl-functions>
_______________________________________________
Gretl-devel mailing list -- gretl-devel@gretlml.univpm.it
To unsubscribe send an email to gretl-devel-le...@gretlml.univpm.it
Website:
https://gretlml.univpm.it/postorius/lists/gretl-devel.gretlml.univpm.it/