Mann-Kendall test
by Sven Schreiber
Hi,
I've just read about the non-parametric Mann-Kendall test for a trend
(hence my recent postings about Kendall's tau and ties in a series).
It looked pretty easy, so I'm attaching an attempt at a basic
implementation. Full disclosure: I've used the description from
https://cran.r-project.org/web/packages/trend/vignettes/trend.pdf (only
the basic version in section 1.1).
All you have to do is call "MannKendall(x)", where x is your series of
interest.
I'd be happy about feedback regarding cross-checks and correctness (for
example in the above document in equ. (4) the case S>0 wrongly appears
twice, and I had to make an educated guess where to switch the
signs...), whether it should become a function package and so on.
thanks,
sven
7 years, 5 months
gretl workdir created if not present
by Sven Schreiber
Hi,
I've noticed that if the workdir that is set in gretl's preferences
doesn't exist, then gretl creates it -- probably not right away, but
when a (data) file is saved.
I'm not saying this is a bug, because it could be the desired behavior.
OTOH I'm not sure if this is really intended by the gretl gods. Is it?
thanks,
sven
7 years, 11 months
problems with automatic matrix-to-scalar conversion
by Sven Schreiber
Hi,
another appearance of the subtle pitfalls of moving back and forth
between a 1x1 matrix and a scalar.
<hansl>
function void matin( const matrix in)
print in
end function
matin( {cdf(N, {3})} ) # works
matin(cdf(N, {3})) # fails
</hansl>
So the cdf() function "destroys" the matrix property here, while I think
it shouldn't. (Don't know which other functions do as well.)
thanks,
sven
7 years, 11 months
nasty (kind of) matrix indexing bug
by Sven Schreiber
Hi,
there seems to be a problem with matrix indexing through vectors when
the indices have all the same single value:
<hansl>
matrix mm = zeros(10, 1)
eval mm[{3, 3, 3} , ] # gives 1x1
eval mm[{3, 3}, ] # gives 1x1
eval mm[{3, 3, 2}, ] # correct 3x1
eval mm[ones(20,1), ] # gives 1x1
</hansl>
thanks,
sven
7 years, 11 months
isnull() / exists() documentation for lists reloaded
by Sven Schreiber
Hi,
I stumbled again over the issue that a "null" default for list types as
a function argument requires different checks than "null" defaults for a
string, for example.
(For lists, only nelem(listinput)==0 will really work, whereas for
string and other types one has to use !exists(stringinput).)
This has been discussed before on the mailing list(s). However, if I
look up the function reference for exists() or nelem() or isnull(), this
doesn't seem to be mentioned, but it would be useful.
thanks,
sven
7 years, 11 months
'omit ... --silent' not entirely silent
by Sven Schreiber
Hi,
a minor issue:
<hansl>
nulldata 1000
loop 100
series x = normal()
series y = normal()
ols y const x --quiet
omit --auto --silent
endloop
</hansl>
You should see a message from 'omit' occurring at random intervals
saying that "no regressors have been omitted". These messages arguably
defeat the purpose of the --silent option.
thanks,
sven
7 years, 11 months
Strings not marked for translation
by Henrique Andrade
Dear Allin,
Today I find two strings that are not marked for translation:
"In regard to function"
And
"Add gretl directory to your PATH"
Best,
Henrique Andrade
7 years, 11 months
Creating arrays in a bundle
by Sven Schreiber
Hi,
I can copy an array to a bundle, but cannot create it there right away.
This time I'm not sure whether it's a bug...
<hansl>
bundle bc = null
strings s = array(3)
strings bc.s = s
strings bc.s2 = array(2) # this fails
</hansl>
(Also fails with matrices array.)
thanks,
sven
7 years, 11 months