powered by
Simulate fluorescence trace based on simple AR(1) generative model
simulate_ar1(n, gam, poisMean, sd, seed)
number of timesteps
AR(1) decay rate
mean for Poisson distributed spikes
standard deviation
random seed
spikes, fluorescence, and calcium concentration
y_t = c_t + eps, eps ~ N(0, sd)
c_t = gam * c_t-1 + s_t
s_t ~ Pois(poisMean)
# NOT RUN { sim <- simulate_ar1(n = 500, gam = 0.998, poisMean = 0.009, sd = 0.05, seed = 1) plot(sim) # }
Run the code above in your browser using DataLab