Home | Trees | Indices | Help |
---|
|
object --+ | SimulatedData --+ | LinearRegressionData
Returns data for linear regression that is generated such that we know the exact solution. The data generated by this function is fit to the Linear regression + L1 + L2 + Smoothed total variation function, i.e.: f(b) = (1 / 2).|Xb - y|²_2 + sum_{i=1}^N l_i.P_i(b), where the P_i(.) are penalty functions. Parameters ---------- penalties : List or tuple. The penalties to add to the linear regression function. X0 : Numpy array (n-by-p). The initial matrix to use when building data. This matrix carries the desired correlation structure of the generated data. The generated data will be a column-scaled version of this matrix. e : Numpy array (n-by-1). The error vector e = Xb - y. This vector carries the desired distribution of the residual. snr : Positive float. Signal-to-noise ratio between model and residual. intercept : Boolean. Whether or not to include an intercept variable. This variable is not penalised. Note that if intercept is True, then e will be centred. Returns ------- X : Numpy array (n-by-p). The generated X matrix. y : Numpy array (n-by-1). The generated y vector. beta : Numpy array (p-by-1). The regression vector with the correct snr (if snr is given).
|
|||
Inherited from |
|
|||
|
|||
|
|||
Inherited from |
|
|||
__abstractmethods__ =
|
|||
Inherited from |
|
|||
Inherited from |
|
x.__init__(...) initializes x; see help(type(x)) for signature
|
Generate the simulated data. Parameters ---------- beta : Numpy array (p-by-1). The regression vector to generate data from.
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Mon Apr 6 23:52:10 2015 | http://epydoc.sourceforge.net |