Save a MLE model
by Filipe Costa

I was trying to estimate a state space model, using MLE and I noticed that even though these can be saved to the session some models are lost when reopening the session. In the example below I'm trying to save the MLE estimation to the session with the name "model1", which is successful but then it's lost at reopening.
Any thoughts on why this happens and on an alternative to save the session?
<hansl>
clear
nulldata 200
set seed 101010
setobs 1 1 --special-time-series
/* set the true variance parameters */
true_s1 = 0.5
true_s2 = 0.25
/* and simulate some data */
v = normal() * sqrt(true_s1)
w = normal() * sqrt(true_s2)
mu = 2 + cum(v)
y = mu + w
/* starting values for variance estimates */
s1 = 1
s2 = 1
/* state-space model set-up */
bundle kb = ksetup(y, 1, 1, s1)
kb.obsvar = s2
kb.diffuse = 1
/* ML estimation of variances */
model1 <- mle ll = ERR ? NA : kb.llt
ERR = kfilter(&kb)
params kb.statevar kb.obsvar
end mle
/* compute the smoothed state */
ksmooth(&kb)
series muhat = kb.state
</hansl>
3 weeks, 5 days

Trying out Octave for the first time in Mac, and it is not working
by Fred Engst

Hi all,
I have downloaded both Octave 4.4.1 disk image & 5.2.0 source code. After installing 4.4.1, and linking gretl’s path to "Octave 4.4.1/Contents/MacOS/applet", I was not able to run the example from the gretl documentation in Chapter 41:
———————————————————————————
open data4-1
matrix m = { dataset }
mwrite(m, "gretl.mat", 1)
foreign language=Octave
gmat = gretl_loadmat("gretl.mat")
end foreign
—————————————————————————
Once I run this, the Octave opens up with a command window, and nothing else is going on. The spinning wheal just keeps on spinning in gretl. Only after I quit Octave will gretl come to life with a script output saying nothing interesting:
——————————————————————————
gretl version 2020d
Current session: 2020-09-29 18:20
? open data4-1
Read datafile /Applications/Gretl.app/Contents/Resources/share/gretl/data/ramanathan/data4-1.gdt
periodicity: 1, maxobs: 14
observations range: 1 to 14
Listing 5 variables:
0) const 1) price 2) sqft 3) bedrms 4) baths
? matrix m = { dataset }
Generated matrix m
? mwrite(m, "gretl.mat", 1)
? foreign language=Octave
? gmat = gretl_loadmat("gretl.mat")
? end foreign
———————————————————————————
What am I doing wrong?
Thanks in advance for your help,
Fred
3 weeks, 6 days

Store simple data from a model
by Filipe Costa

Dear Gretl users,
I was trying to retrieve some data from an estimated model but I'm not sure that's possible.
An example:
<hansl>
open australia.gdt
# simple ols model
ols E 0 PAU PUS
# scalars for the coefficients
coef1 = $coeff[1]
coef2 = $coeff[2]
# scalars for the standard errors
stderr1 = $stderr[1]
stderr2 = $stderr[2]
</hansl>
Is it possible to retrieve data for the test statistic and p-value for the independent variables like I do for the coefficient and standard error estimations?
Thanks,
Filipe
4 weeks

specific bandwidth for kernel/HAC estimation
by Sven Schreiber

Hi,
there is some old code by Jack that implements a specific data-based
bandwidth choice for the typical estimation of the long-run
(co)variance. It is primarily meant for a quadratic kernel. I'm
including the hansl function at the end.
My question is: Is that choice somehow already implemented in gretl
through some "set" option? I know I can choose the quadratic kernel via
"set hac_kernel qs", and its bandwidth via "set qs_bandwidth
<something>". But is there something built-in that sets the bandwidth to
what the function below returns?
If not, would it make sense to add that option?
thanks
sven
--------
function matrix c_bandw (const matrix vhat)
# procedure that computes the automatic bandwidth based on AR(1)
# approximation for each vector of the matrix vhat. Each are given
# equal weigths of 1.
nt = rows(vhat)
matrix vt = vhat[2:nt, ]
matrix vlag = vhat[1:nt-1, ]
matrix b = sumc(vt .* vlag) ./ sumc(vlag.^2)
matrix tmp = (1 - b) .^ 4
matrix res = vt - vlag .* b
matrix sig = sdc(res) .^ 2
matrix a2n = sumr( (2 .* b .* sig) .^2 ./ tmp )
matrix a2d = sumr( sig .* sig ./ tmp )
matrix a2 = sumr(a2n) / sumr(a2d)
return 1.3221 * (a2 * nt) .^ 0.2
end function
1 month

yahoo_get.gfn - (1) RHT ticker and (2) non-existent ticker will give NAs
by Ioannis A. Venetis

Hello all, especially Jack who wrote the package!!!.
I run gretl2020d on Windows (I think last version of them).
Also I installed yahoo_get 3.0
When running yahoo_get.gfn sample script I get two "errors"
(1) It does not find the redhat ticker
? series redhat = yahoo_price("RHT") # get Red Hat, adjusted price only
Ticker RHT not found
Generated series redhat (ID 1)
(2) it does not fill non-existent ticker with NAs (if that's the
expected function here). I get the following
? series foo = yahoo_price("ZZZ") # a non-existent ticker will give
NAs
An error occurred when 'outfile' was active
jsonget: failed to match JsonPath
*** error in function json2csv, line 1
> dates = strsplit(jsonget(jsonbuf, "$.chart.result[0].timestamp[*]"), "\n")
called by function write_tempfile
called by function yahoo_price
Error executing script: halting
> series foo = yahoo_price("ZZZ") # a non-existent ticker will give NAs
1 month, 1 week

Repeated crashes while copying and pasting graphs from gretl to powerpoint
by Fred Engst

Hi Allin,
Today gretl crashed quite a few times, each time while I was trying to copy a graph that I've saved to icon view and past it onto powerpoint slide.
Not all copy and past crashes, just after I do some editing and then trying to copy and past. So far I have not been able to isolate under what condition it will cause a crash.
Here are the first few lines of the crash report:
Process: gretl [84502]
Path: /Applications/Gretl.app/Contents/MacOS/gretl
Identifier: net.sourceforge.gretl
Version: 2020c-git
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: gretl [84502]
User ID: 502
Date/Time: 2020-09-13 10:27:19.343 +0800
OS Version: Mac OS X 10.14.6 (18G6020)
Report Version: 12
Bridge OS Version: 4.6 (17P6065)
Anonymous UUID: D0C17D83-C8DE-88A8-08E7-19E42233A73F
Sleep/Wake UUID: 81648553-B133-4CC9-B07F-49D8C2578A6A
Time Awake Since Boot: 280000 seconds
Time Since Wake: 57000 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000070
Exception Note: EXC_CORPSE_NOTIFY
Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [84502]
attached is the full report.
If I can figure out what exactly causes the crash, I will update you.
Best,
Fred
1 month, 2 weeks

series indexing
by Riccardo (Jack) Lucchetti

A user wrote me in private, asking me about some oddities on series
indexing via strings. I put together a little example:
<hansl>
nulldata 4
xs = normal(2,1)
setobs 1 2000 --time-series
# 1: this works
xs["2000"] = 3
# 2: this works too
a = sprintf("\"2000\"")
xs[@a] = 33
# 3: this doesn't
a = "2000"
xs[a] = 33
</hansl>
if assignments 1 and 2 work, one sees no reason why 3 shouldn't work too.
Or ami I missing something obvious?
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------
1 month, 2 weeks

Seasonal adjustment programs for Fedora 32 gretl
by Luke Hartigan

Dear all,
I have installed gretl on my Fedora 32 workstation via the official
Fedora repo. There does not seem to be any packages in the official
repo that contain the two seasonal adjustment programs X-12-ARIMA and
TRAMO/SEATS. Are the two '.rpm' files available on the gretl website
suitable for use with the Fedora 32 version of gretl? Further, what
does the 'i586' stand for in the package names for each program?
Many thanks,
Luke
1 month, 2 weeks

Functionality of functions meanc() - meanr()
by Alecos Papadopoulos

Gretl 2020d, Windows 64-bit.
I give the command
matrix meancolumnsB = meanc(B)
The matrix "meancolumnsB " is generated as a single-row matrix as
expected, but with "nan" in all its cells.
I can see the matrix B ok, it is a 10000 X 9 matrix, I can copy-paste
it, export it in spreadsheet etc.
What I observe is that there are 6 rows in the "B" matrix with "nan"
values.
So it appears that the meanc() function , in contrast to the mean()
function, cannot skip missing values?
If this is the case can we do something about it? The matrix B collects
results from MLE simulations, and there are various instances where we
are bound to get a "nan" value (the MLE did not converge, or the B may
collect the elements of the Hessian but the Hessian is not computable
and the algorithm drops back to OPG, etc)
Note: I also run
matrix meanrowsB = meanr(B)
Here, the result came out ok, with a "nan" result for the 6 rows of "B"
that were filled with "nan" originally. But what would happen if in some
row I would have some numbers and some "nan"? Will the meanr() return
then a "nan" result?
--
Alecos Papadopoulos PhD
Athens University of Economics and Business
web: alecospapadopoulos.wordpress.com/
skype:alecos.papadopoulos
1 month, 2 weeks