Sorry for so many questions ;) I still find new ones.

 

a)       Is there a way to access rownames similar to ‘colname(matrix M, scalar column)’? If yes, do rownames default to the index, if not explicitly provided? How das print matrix access the rownames?

 

b)      I am trying to find a solution to get the observation number of a specific entry of a series in a subsampling (i.e., the integer with which I could access this entry in the full sample), in order to synchronise it with a matrix OBSDATE I have in a bundle that is passed to this function and holds string labels for each element in the full sample.
I can check via $nobs == nrows(OBSDATE) if there is a subsampling (which will not always work..), but I do not know, how I can then treat with it (in both cases, time-series data and cross-section data). If I use “obs” to generate a new series, than it does not relate to the global identifiers but creates a new, small series of consecutive integers (as is stated within the help). At the same time, the series within the bundle is not synchronised with the global series’. Is there a way to deal with this? Or is the only option to print an error message and demand that the bundle is reinitialised accordingly with a series “obsdate=obs” from outside any function definition? Isn’t there a (hidden) accessor for a series entries’ real (i.e. in full sample) obsnumber/date?

 

perhaps $sample is an option? (Although I do not know how…     ) and basically $t1 and $t2 work for the first and last element in the current (sub)sample, but the values in between are not provided?

 

c)       Misc. feedback :

a.       obs and obsnum are not highlighted in the editor (but the question mark works nonetheless)

b.       Instead of “varname()” one needs to use “argname()” to get the name of a series (even when passed by pointer). This could be noted in the gretl help (q-mark in script editor)

c.       neither argname nor varname work on elements contained within a bundle. It does also not help to make an new series from the series within the bundle (btw., pointer arithmetic is not allowed at all in this case). It would be nice if this would work. My Workaround is to have a special function that “adds” series to the bundle and, at the same time, adds a key-entry for the series name.

d.       A recursive “exists” for bundles would be nice. I.e. if I ask “exists(a.b.x)” it is checked if x exists, but if “b” already is missing, an error is produced. Perhaps a exists(a.b.x) --recursive option? Alternatively, if conditions would be checked one at a time, this would also help. For example ‘if exists(a.b) && exists(a.b.x)’ does not work if a.b does not exist (https://en.wikipedia.org/wiki/Short-circuit_evaluation)

d)      Misc. questions:

a.       When I attach, within a function, a genr element (like series) that was passed by pointer to the function, to a bundle, it is in fact copied (hansl-primer p.20). Is there a way to instead add pointers to the bundle? Perhaps by means of using the array type?

Thanks

Frederik