The manual suggest the following:
take a random sample of size n without replacement from the rows of a matrix x (this requires oxprob.oxh):
y = x[ ransubsample(n, rows(x) - 1) ][];
Or using ranindex which returns unsorted random indices:
y = x[ ranindex(n, rows(x)) ][];
Heino
*****************************************************
Heino Bohn Nielsen
Professor MSO
Department of Economics, University of Copenhagen
Øster Farimagsgade 5, bygning 26, 1353 København K.
*****************************************************
-----Original Message-----
From: The ox-users list is aimed at all Ox users [mailto:[log in to unmask]] On Behalf Of Eliane Pinheiro
Sent: 1. marts 2018 16:44
To: [log in to unmask]
Subject: sample from given data
Dear all,
Is there an implemented function to sample without replacement from a given data?
Thank you in advance
Eliane
|