## Not run:
# ## Get the e070528citronellal data set into workspace
# data(e070528citronellal)
# ## Compute gsspsth without a plot for neuron 1
# ## using a smmothing spline with gssanova0, and default bin size of 25 ms.
# n1CitrGSSPSTH0 <- gsspsth0(e070528citronellal[[1]])
# ## plot the result
# plot(n1CitrGSSPSTH0,stim=c(6.14,6.64),colCI=2)
# ## get a summary of the gss fit
# summary(n1CitrGSSPSTH0)
# ## Now take a look at the observation on which the gss
# ## was actually performed
# plot(n1CitrGSSPSTH0$mids,n1CitrGSSPSTH0$counts,type="l")
# ## Add the estimated smooth psth after proper scaling
# theBS <- diff(n1CitrGSSPSTH0[["mids"]])[1]
# Y <- n1CitrGSSPSTH0$lambdaFct(n1CitrGSSPSTH0$mids)*theBS*n1CitrGSSPSTH0$nbTrials
# lines(n1CitrGSSPSTH0$mids,Y,col=4,lwd=2)
#
# ## check the (absence of) effect of the pre-binning by using a smaller
# ## and larger one, say 10 and 75 ms
# n1CitrGSSPSTH0_10 <- gsspsth0(e070528citronellal[[1]],binSize=0.01)
# n1CitrGSSPSTH0_75 <- gsspsth0(e070528citronellal[[1]],binSize=0.075)
# ## plot the "high resolution" smoothed-psth
# plot(n1CitrGSSPSTH0_10,colCI="grey50")
# ## add to it the estimate obtained with the "low resolution" one
# Y_75 <- n1CitrGSSPSTH0_75$lambdaFct(n1CitrGSSPSTH0_10$mids)
# lines(n1CitrGSSPSTH0_10$mids,Y_75,col=2,lwd=2)
#
# ## simulate data from the first fitted model
# s1 <- simulate(n1CitrGSSPSTH0)
# ## look at the result
# s1
#
# ## Do the same thing with gsspsth
# n1CitrGSSPSTH <- gsspsth(e070528citronellal[[1]])
# plot(n1CitrGSSPSTH,stim=c(6.14,6.64),colCI=2)
# summary(n1CitrGSSPSTH)
# plot(n1CitrGSSPSTH$mids,n1CitrGSSPSTH$counts,type="l")
# theBS <- diff(n1CitrGSSPSTH[["mids"]])[1]
# Y <- n1CitrGSSPSTH$lambdaFct(n1CitrGSSPSTH$mids)*theBS*n1CitrGSSPSTH$nbTrials
# lines(n1CitrGSSPSTH$mids,Y,col=4,lwd=2)
# ## check the (absence of) effect of the pre-binning by using a smaller
# ## and larger one, say 10 and 75 ms
# n1CitrGSSPSTH_10 <- gsspsth(e070528citronellal[[1]],binSize=0.01)
# n1CitrGSSPSTH_75 <- gsspsth(e070528citronellal[[1]],binSize=0.075)
# ## plot the "high resolution" smoothed-psth
# plot(n1CitrGSSPSTH_10,colCI="grey50")
# ## add to it the estimate obtained with the "low resolution" one
# Y_75 <- n1CitrGSSPSTH_75$lambdaFct(n1CitrGSSPSTH_10$mids)
# lines(n1CitrGSSPSTH_10$mids,Y_75,col=2,lwd=2)
# ## simulate data from the first fitted model
# s1 <- simulate(n1CitrGSSPSTH)
# ## look at the result
# s1
# ## End(Not run)
Run the code above in your browser using DataLab