Smooths a lockedTrain
object using a gam
model with the Poisson
family after binning the object.
1 2 3 4 5 6 7 
lockedTrain 
a 
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 
k 
the dimension of the basis used to represent the smooth
psth. See 
x 
an 
object 
an 
xlim 
a numeric (default value supplied). See

ylim 
a numeric (default value supplied). See 
xlab 
a character (default value supplied). See 
ylab 
a character (default value supplied). See 
main 
a character (default value supplied). See 
lwd 
line width used to plot the estimated density. See 
col 
color used to plot the estimated density. See 
... 
additional arguments passed to 
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.
A list of class slockedTrain
is returned by
slockedTrain
. This list has the following components:
gamFit 
the 
Time 
the vector of bin centers. 
nRef 
the number of spikes in the reference train. See

testFreq 
the mean frequency of the test neuron. See

bwV 
the vector of bin widths used. 
CCH 
a logical which is 
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.
Christophe Pouzat christophe.pouzat@gmail.com
Wood S.N. (2006) Generalized Additive Models: An Introduction with R. Chapman and Hall/CRC Press.
lockedTrain
,
plot.lockedTrain
,
gam
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))

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
All documentation is copyright its authors; we didn't write any of that.