Package parsimony :: Package datasets :: Package simulate :: Module beta
[hide private]
[frames] | no frames]

Module beta

source code

Created on Thu Sep 26 10:12:56 2013

Copyright (c) 2013-2014, CEA/DSV/I2BM/Neurospin. All rights reserved.


Author: Tommy Löfstedt

License: BSD 3-clause.

Functions [hide private]
 
random(shape, density=1.0, rng=<bound method RandomUniform.rand of <parsimony.datasets.simula..., sort=False, normalise=False)
Generates a random p-by-1 vector.
source code
Variables [hide private]
  __package__ = 'parsimony.datasets.simulate'
Function Details [hide private]

random(shape, density=1.0, rng=<bound method RandomUniform.rand of <parsimony.datasets.simula..., sort=False, normalise=False)

source code 
Generates a random p-by-1 vector.

shape : A tuple. The shape of the underlying data. E.g., beta may represent
        an underlying 2-by-3-by-4 image, and will in that case be 24-by-1.

density : A scalar in (0, 1]. The density of the returned regression vector
        (fraction of non-zero elements). Zero-elements will be randomly
        distributed in the vector. Default is 1.0.

rng : The random number generator. Must be a function that takes *shape as
        input. Default is utils.RandomUniform in the interval [0, 1).

sort : A boolean. Whether or not to sort the vector. The vector is sorted
        along the dimensions in order from the first. Default is False.

normalise : A boolean. Whether or not to normalise the vector. Default is
        False.