Description Usage Arguments Details See Also Examples
compute.local_rates
is a method for calculating the within-session local rate of some variable. Currently, methods are defined for the classes analysis_object
and its child class simulation_analysis_object
.
1 2 3 4 | compute.local_counts(data, event_name, marker, event_offset = 0,
marker_offset)
compute.local_rates(local_times, visit_lengths, n_bins, bin_size)
|
data |
Either an object of class |
marker |
A variable with which to calculate the local rates within. |
marker_offset |
The duration of the |
x_event |
A variable with which to calculate the local rates over. |
x_offset |
The duration of the |
x_offset
and marker_offset
If the x_event
or the marker
event have non-zero durations, the x_offset
and marker_offset
allow for the correction of the x_event
s in each bin. For example, if the local response rate is defined by the reinforcement deliveries and the reinforcement delivery lasts 3 seconds, set marker_offset = -3
to subtract out the reinforcement time.
In situations where there is only one marker
event, compute.local_rates
returns a single Inf
. This would be the case if the user were to calculate the inter-reinforcement response times, but only one reinforcement delivery occurred during a particular simulation.
dataset
classWhen compute.local_rates
is called on a dataset
class, it calls the appropriate compute.local_rates
for each element in the analysis_objects
slot
class.analysis_object
For constructing arguments for data
parameter.
1 2 3 | #Suppose "d" is your data in an "analysis_object", "resp_time" is the response time, "rft_time" is the reinforcement time, reinforcement is delivered for 3 units of time and the operandum takes 1 unit of time to operate.
#Compute the local response rate accounting for the time to make a response and the time taken up by reinforcment
local_resp_rate = compute.local_rates( d, x_event = "resp_time", marker = "rft_time", x_event_offset = -1, marker_offset = -3 )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.