htbGetHis | R Documentation |
Creates htbHis object from htbRas objects.
htbGetHis(ras, xlim = NULL, bin = 200, sep = 10)
ras |
An |
xlim |
A pair of numerics.
The range |
bin |
A numeric. The temporal width of the sliding window to calculate a histogram. |
sep |
A numeric. The width of a step of the sliding window. |
In examining neural activities,
creating a histogram is one of the most elementary starting points.
A histogram visualizes the transition of instantaneous
firing rates of a neuron, calculated by
sequential averaging of number of spikes
with a sliding window of arbitrary width and steps.
For this, you need multiple lines of spike sequence
(normaly the trials in the task) aligned
at a time of certain external event.
Therefore, the source of a histogram is naturally
the data used to create a rastergram,
i.e., htbRas
object in htb package.
htbGetHis()
does this transformation for a set of spike sequences
packed as an htbRas
object.
Result is returned as a specialized list named htbHis
object,
containing a series of temporally smoothed firing rates
composed of the same set of task conditions with the source htbRas
object.
The major parameter of a histogram is the width and steps
of the sliding window for averaging.
These parameters are designated by bin
and sep
arguments, respectively.
If you use the same value (e.g., 100
) for both bin
and sep
,
it means that averaging windows adjoin each other without overlaps.
This is suitable for traditional histograms
that look like a lined skyscraper of buildings.
If you use small sep
compared with bin
,
it means that the sliding window moves in a smaller stride.
The windows overlap each other, but multiple usage (counting) of
the same spikes by neighboring windows does not matter
since the spike counts are anyway divided by the time width of the window.
Thus, this setting simply results in a smoothed version
of traditional histogram.
If you set larger value for sep
than bin
,
the windows get spaces in between.
This result in ignoring your precious spikes falled into these spaces,
and thus is normally no use.
An htbHis
object.
alignment <- list(CUEON_L = c(-1500, 2000), CUEON_R = c(-1500, 2000))
incld <- list(TRIALSTART = c(-2000, 0), TRIALEND = c(0, 2000))
excld <- list(ERROR = c(0, 2000))
## Not run:
db_sp <- htbGetDb("spike.htb")
db_ev <- htbGetDb("event.htb")
ras <- htbGetRas(db_sp, db_ev, alignment,
incld = incld, excld = excld)
his <- htbGetHis(ras)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.