samedi 11 novembre 2017

Generate n artificial points in given n-dimensional space, but no point should be present in original space in R

I want to generate n artificial points with uniform distribution in a given n-dimensional Original_space, but no artificial point should be present in the Original_space.

Example:

> Original_space = matrix(sample(runif(10,0,1), 9*100, TRUE),4,6)
> Original_space
          [,1]       [,2]       [,3]      [,4]       [,5]      [,6]
[1,] 0.9353045 0.65987073 0.12301011 0.6598707 0.01346191 0.4676935
[2,] 0.1230101 0.01346191 0.46769352 0.6598707 0.01346191 0.6660970
[3,] 0.3539783 0.66609697 0.67533240 0.6753324 0.46769352 0.9353045
[4,] 0.9076819 0.90768191 0.05189017 0.6660970 0.46769352 0.4676935

new n-artificial points should be generated uniformly in the above space, but none should be an exact match to the above space.




Aucun commentaire:

Enregistrer un commentaire