Yes, I know that sesampling rows of a matrix is something one can do easily
with the existing gretl tools. See the discussion here:
http://lists.wfu.edu/pipermail/gretl-devel/2007-December/000730.html
However, I still think it should be included natively in gretl by extending
the resample() command so that it can be used with mxn matrices too. It
would be easier, more natural and less error-prone to use B = resample(A)
instead of writing special code every time.
Best regards
Andreas
cottrell(a)wfu.edu @ INTERNET skrev 2008-01-29 04:19:50 :
On Mon, 28 Jan 2008, andreas.rosenblad(a)ltv.se wrote:
> I think that at least some of feature requests should be >
targeted before the release of a new version. At least feature >
requests 1854919 and 1855731, I hope.
Re. 1854919: Resampling rows of a matrix is something you can do
easily with the existing gretl tools, there's no need for a special
function. (We're systematizing the documentation for all gretl
functions, so hopefully this sort of thing should become more apparent.)
For example:
nulldata 5
scalar T = 20 # rows of original matrix
scalar R = 20 # resampled rows: you choose
matrix A = mnormal(T,2)
matrix rsel = int(muniform(R,1)*T+1)
matrix B = A[rsel]
print A B rsel
One small thing: the line "matrix B = A[rsel]" works fine, but it
might be more transparent if it read
matrix B = A[rsel,]
Unfortunately the latter variant doesn't work in the current release
because of a stupid copy-n-paste bug in the code for parsing matrix
sub-slices, but that's fixed in CVS.
Allin.
_______________________________________________
Gretl-devel mailing list
Gretl-devel(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-devel