compute.local_rates: Compute local rates

Description Usage Arguments Details See Also Examples

Description

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.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
compute.local_rates(data, x_event, marker, x_offset = 0, marker_offset = 0)

## S4 method for signature 'simulation_analysis_object'
compute.local_rates(data, x_event,
  marker, x_offset = 0, marker_offset = 0)

## S4 method for signature 'analysis_object'
compute.local_rates(data, x_event, marker,
  x_offset = 0, marker_offset = 0)

## S4 method for signature 'dataset'
compute.local_rates(data, x_event, marker, x_offset = 0,
  marker_offset = 0)

Arguments

data

Either an object of class simulation_analysis_object, analysis_object, or dataset.

x_event

A variable with which to calculate the local rates over.

marker

A variable with which to calculate the local rates within.

x_offset

The duration of the x_event. Defaults to 0.

marker_offset

The duration of the marker_offset. Defaults to 0.

Details

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_events 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.

Exceptions

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.

Method for the dataset class

When compute.local_rates is called on a dataset class, it calls the appropriate compute.local_rates for each element in the analysis_objects slot

See Also

class.analysis_object For constructing arguments for data parameter.

Examples

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 )

Don-Li/CAB_original documentation built on May 6, 2019, 2:53 p.m.