Description Usage Arguments Details Value Author(s) References See Also Examples
Spike trains discharge models for single neurons are rarely
renewal. They require more information than just the elapsed time
since the last spike. Function brt4df
generates this additional
information from a data frame obtained by mkGLMdf
.
1 2 |
df |
A |
varName |
The name of one of the variables of |
max.order |
How many events should looked for in the past? |
colNames |
Names of the columns of the returned
|
auto |
A logical. Does |
normalise |
A |
If the spike required to evaluate the elapsed time is not contained in
df
then NA
will be the reported elapsed time.
A data.frame
is returned with as many variable as
max.order
and as many rows as df
.
Christophe Pouzat christophe.pouzat@gmail.com
Kass, Robert E. and Ventura, Val\'erie (2001) A spike-train probability model Neural Comput. 13: 1713–1720.
Truccolo, W., Eden, U. T., Fellows, M. R., Donoghue, J. P. and Brown, E. N. (2005) A Point Process Framework for Relating Neural Spiking Activity to Spiking History, Neural Ensemble and Extrinsic Covariate Effects J Neurophysiol 93: 1074–1089. http://jn.physiology.org/cgi/content/abstract/93/2/1074
mkGLMdf
,
data.frame
,
glm
,
mgcv
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 27 28 | ## Not run:
## Let us consider neuron 1 of the CAL2S data set
data(CAL2S)
CAL2S <- lapply(CAL2S,as.spikeTrain)
CAL2S[["neuron 1"]]
renewalTestPlot(CAL2S[["neuron 1"]])
summary(CAL2S[["neuron 1"]])
## Make a data frame with a 4 ms time resolution
cal2Sdf <- mkGLMdf(CAL2S,0.004,0,60)
## keep the part relative to neuron 1
n1.cal2sDF <- cal2Sdf[cal2Sdf$neuron=="1",]
## remove unnecessary data
rm(cal2Sdf)
## Extract the elapsed time since the second to last and
## third to last for neuron 1. Normalise the result.
n1.cal2sDF[c("rlN.1","rsN.1","rtN.1")] <- brt4df(n1.cal2sDF,"lN.1",2,c("rlN.1","rsN.1","rtN.1"))
## load mgcv library
library(mgcv)
## fit a model with a tensorial product involving the last
## three spikes and using a cubic spline basis for the last two
n1S.fitA <- gam(event ~ te(rlN.1,rsN.1,bs="cr") + rtN.1,data=n1.cal2sDF,family=binomial(link="logit"))
summary(n1S.fitA)
## plot the result in 2 different ways
plot(n1S.fitA)
vis.gam(n1S.fitA,phi=20,theta=45)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.