Description Usage Arguments Details Value Note Author(s) References See Also Examples
Function gampsth
computes a smooth psth, while method
print.gampsth
prints and summary.gampsth
summarises the
gamObject
contained in the returned gampsth
object and
plot.gampsth
plots it.
1 2 3 4 5 6 7 8 9 10 | gampsth(repeatedTrain, binSize = 0.025, k = 100,
bs = "tp", plot = TRUE,...)
## S3 method for class 'gampsth'
print(x, ...)
## S3 method for class 'gampsth'
summary(object, ...)
## S3 method for class 'gampsth'
plot(x, stimTimeCourse = NULL, colStim = "grey80",
colCI = NULL, xlab, ylab, main, xlim, ylim,
lwd = 2, col = 1, ...)
|
repeatedTrain |
a |
binSize |
the bin size (in s) used to generate the observations on which the gam fit will be performed. See details below. |
k |
the dimension of the basis used to represent the smooth
psth. See |
bs |
the type of splines used. See |
plot |
corresponding argument of |
object |
a |
x |
a |
stimTimeCourse |
|
colStim |
the background color used for the stimulus. |
colCI |
if not |
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 |
... |
in |
For gampsth
, the raw data contained in repeatedTrain
are
pre-processed with hist
using a bin size given by
argument binSize
. This binSize
should be small "enough". That is, the
rate of the aggregated train created by collapsing the spike times of
the different trials onto a single "pseudo" spike train, should not
change too much on the scale of binSize
(see Ventura et al
(2002) Sec. 4.2 p8 for more details).
When plot
is set to FALSE
in gampsth
, a list of
class gampsth
is returned and no plot
is generated. This list has the following components:
freq |
a vector containing the instantaneous firing rate in the middle of the "thin" bins used for preprocessing. |
ciUp |
a vector with the upper limit of a pointwise 95% confidence interval. Check |
ciLow |
a vector with the lower limit of a pointwise 95% confidence interval. |
breaks |
a vector with 2 elements the ealiest and the latest spike in |
mids |
a numeric vector with the mid points of the bins. |
counts |
a vector with the actual number of spikes in each bin. |
nbTrials |
the number of trials in |
lambdaFct |
a function of a single time argument returning the estimated intensity (or instantaneous rate) at its argument. |
LambdaFct |
a function of a single time argument returning the
integrale of estimated intensity (or instantaneous rate) at its
argument. That is, the integrated intensity. |
call |
the matched call. |
When plot
is set to TRUE
nothing is returned and a plot
is generated as a side effect. Of course the same occurs upon calling
plot.gampsth
with a gampsth
object argument.
print.gampsth
returns the result of print.gam
applied to the gamObject
generated by gampsth
and stored in the environment
of both lambdaFct
and LambdaFct
.
summary.gampsth
returns the result of summary.gam
applied to the gamObject
generated by gampsth
and stored in the environment
of both lambdaFct
and LambdaFct
.
Most of the components of the list returned by gampsth
are not of
direct interest for the user but they are used by, for instance,
reportHTML.repeatedTrain
.
Christophe Pouzat christophe.pouzat@gmail.com
Ventura, V., Carta, R., Kass, R. E., Gettner, S. N. and Olson, C. R. (2002) Statistical analysis of temporal evolution in single-neuron firing rates. Biostatistics 3: 1–20.
Kass, R. E., Ventura, V. and Cai, C. (2003) Statistical smoothing of neuronal data. Network: Computation in Neural Systems 14: 5–15.
Wood S.N. (2006) Generalized Additive Models: An Introduction with R. Chapman and Hall/CRC Press.
psth
,
plot.psth
,
gam
,
print.gam
,
summary.gam
,
gam.check
,
reportHTML.repeatedTrain
,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | ## Not run:
## Get the e070528citronellal data set into workspace
data(e070528citronellal)
## Compute gampsth without a plot for neuron 1
## using a cubic regression spline
n1CitrGAMPSTH <- gampsth(e070528citronellal[[1]],plot=FALSE,bs="cr")
## plot the result
plot(n1CitrGAMPSTH,stim=c(6.14,6.64),colCI=2)
## get a summary of the gam fit
summary(n1CitrGAMPSTH)
## perhaps get a more complete check wit gam.check
n1CitrGAMPSTHgo <- gamObj(n1CitrGAMPSTH)
gam.check(n1CitrGAMPSTHgo)
## It does not look too bad
## Now take a look at the observation on which the gam
## was actually performed
plot(n1CitrGAMPSTH$mids,n1CitrGAMPSTH$counts,type="l")
## put dots at the positions of the knots
X <- n1CitrGAMPSTHgo$smooth[[1]][["xp"]]
rug(X,col=2)
## Add the estimated smooth psth after proper scaling
theBS <- diff(n1CitrGAMPSTH[["mids"]])[1]
Y <- n1CitrGAMPSTH$lambdaFct(n1CitrGAMPSTH$mids)*theBS*n1CitrGAMPSTH$nbTrials
lines(n1CitrGAMPSTH$mids,Y,col=4,lwd=2)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.