@@ -122,7 +122,7 @@ def _build_formula_contrasts(spec, fields, order):
122
122
123
123
def event_design (event_spec , t , order = 2 , hrfs = (glover ,),
124
124
level_contrasts = False ):
125
- """ Create design matrix from event specification `event_spec`
125
+ """ Create design matrix at times `t` for event specification `event_spec`
126
126
127
127
Create a design matrix for linear model based on an event specification
128
128
`event_spec`, evaluating the design rows at a sequence of time values `t`.
@@ -145,19 +145,18 @@ def event_design(event_spec, t, order=2, hrfs=(glover,),
145
145
A sequence of (symbolic) HRFs that will be convolved with each event.
146
146
Default is ``(glover,)``.
147
147
level_contrasts : bool, optional
148
- If True, generate contrasts for each individual level
149
- of each factor.
148
+ If True, generate contrasts for each individual level of each factor.
150
149
151
150
Returns
152
151
-------
153
152
X : np.ndarray
154
153
The design matrix with ``X.shape[0] == t.shape[0]``. The number of
155
154
columns will depend on the other fields of `event_spec`.
156
155
contrasts : dict
157
- Dictionary of contrasts that is expected to be of interest from the event
158
- specification. Each interaction / effect up to a given order will be
159
- returned. Also, a contrast is generated for each interaction / effect for
160
- each HRF specified in hrfs.
156
+ Dictionary of contrasts that is expected to be of interest from the
157
+ event specification. Each interaction / effect up to a given order will
158
+ be returned. Also, a contrast is generated for each interaction / effect
159
+ for each HRF specified in ` hrfs` .
161
160
"""
162
161
fields = list (event_spec .dtype .names )
163
162
if 'time' not in fields :
@@ -201,7 +200,7 @@ def block_design(block_spec, t, order=2, hrfs=(glover,),
201
200
convolution_dt = 0.02 ,
202
201
hrf_interval = (0. ,30. ),
203
202
level_contrasts = False ):
204
- """ Create a design matrix from specification of blocks `block_spec`
203
+ """ Create design matrix at times `t` for blocks specification `block_spec`
205
204
206
205
Create design matrix for linear model from a block specification
207
206
`block_spec`, evaluating design rows at a sequence of time values `t`.
@@ -211,8 +210,10 @@ def block_design(block_spec, t, order=2, hrfs=(glover,),
211
210
----------
212
211
block_spec : np.recarray
213
212
A recarray having at least a field named 'start' and a field named 'end'
214
- signifying the block time, and all other fields will be treated as
215
- factors in an ANOVA-type model.
213
+ signifying the block onset and offset times. All other fields will be
214
+ treated as factors in an ANOVA-type model. If there is no field other
215
+ than 'start' and 'end', add a single-level placeholder block type
216
+ ``_block_``.
216
217
t : np.ndarray
217
218
An array of np.float values at which to evaluate the design. Common
218
219
examples would be the acquisition times of an fMRI image.
@@ -239,13 +240,13 @@ def block_design(block_spec, t, order=2, hrfs=(glover,),
239
240
Returns
240
241
-------
241
242
X : np.ndarray
242
- The design matrix with X.shape[0] == t.shape[0]. The number of
243
- columns will depend on the other fields of block_spec.
243
+ The design matrix with `` X.shape[0] == t.shape[0]`` . The number of
244
+ columns will depend on the other fields of ` block_spec` .
244
245
contrasts : dict
245
- Dictionary of contrasts that is expected to be of interest from
246
- the block specification. For each interaction / effect up to a
247
- given order will be returned. Also, a contrast is generated for
248
- each interaction / effect for each HRF specified in hrfs.
246
+ Dictionary of contrasts that are expected to be of interest from the
247
+ block specification. Each interaction / effect up to a given order will
248
+ be returned. Also, a contrast is generated for each interaction / effect
249
+ for each HRF specified in ` hrfs` .
249
250
"""
250
251
fields = list (block_spec .dtype .names )
251
252
if 'start' not in fields or 'end' not in fields :
0 commit comments