Function to Smooth a lockedTrain Object and Related Methods

Share:

Description

Smooths a lockedTrain object using a gam model with the Poisson family after binning the object.

Usage

1
2
3
4
5
6
7
slockedTrain(lockedTrain, bw = 0.001, bs = "cr", k = 100, ...)
## S3 method for class 'slockedTrain'
print(x, ...)
## S3 method for class 'slockedTrain'
summary(object, ...)
## S3 method for class 'slockedTrain'
plot(x, xlab, ylab, main, xlim, ylim, col, lwd, ...)

Arguments

lockedTrain

a lockedTrain object.

bw

the bin width (in s) used to generate the observations on which the gam fit will be performed. See details below.

bs

the type of splines used. See s.

k

the dimension of the basis used to represent the smooth psth. See s.

x

an slockedTrain object.

object

an slockedTrain object.

xlim

a numeric (default value supplied). See plot.

ylim

a numeric (default value supplied). See plot.

xlab

a character (default value supplied). See plot.

ylab

a character (default value supplied). See plot.

main

a character (default value supplied). See plot.

lwd

line width used to plot the estimated density. See plot.

col

color used to plot the estimated density. See plot.

...

additional arguments passed to gam in slockedTrain. Not used in print.slockedTrain and summary.slockedTrain. Passed to plot in plot.slockedTrain.

Details

slockedTrain essentially generates a smooth version of the histogram obtained by hist.lockedTrain. The Idea is to build the histogram first with a "too" small bin width before fitting a regression spline to it with a Poisson distribution of the observed counts.

Value

A list of class slockedTrain is returned by slockedTrain. This list has the following components:

gamFit

the gamObject generated.

Time

the vector of bin centers.

nRef

the number of spikes in the reference train. See hist.lockedTrain.

testFreq

the mean frequency of the test neuron. See hist.lockedTrain.

bwV

the vector of bin widths used.

CCH

a logical which is TRUE if a cross-intensity was estimated and FALSE in the case of an auto-intensity.

call

the matched call.

print.slockedTrain returns the result of print.gam applied to the component gamFit of its argument.

summary.slockedTrain returns the result of summary.gam applied to the component gamFit of its argument.

Author(s)

Christophe Pouzat christophe.pouzat@gmail.com

References

Wood S.N. (2006) Generalized Additive Models: An Introduction with R. Chapman and Hall/CRC Press.

See Also

lockedTrain, plot.lockedTrain, gam

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## load e070528spont data set
data(e070528spont)
## create a lockedTrain object with neuron 1 as reference
## and neuron 3 as test up to lags of +/- 250 ms
lt1.3 <- lockedTrain(e070528spont[[1]],e070528spont[[3]],laglim=c(-1,1)*0.25)
## look at the cross raster plot
lt1.3
## build a histogram of it using a 10 ms bin width
hist(lt1.3,bw=0.01)
## do it the smooth way
slt1.3 <- slockedTrain(lt1.3)
plot(slt1.3)
## do some check on the gam fit
summary(slt1.3)
gam.check(gamObj(slt1.3))

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.