Hi Eftychios, Could you please let me know how you check for the convergence, i.e. where does it happen in cont_ca_sampler? I think I kind of know where you do it in constrained_foopsi: in cvx_foopsi I think the following part does it, if not could you please correct me?

minimize(w'*(G*c2))

subject to

G*c2>=0; norm(y(keep)-c2(keep)-b-c1*gd_vec(keep))<=sqrt(sum(keep))*sn;

But I cannot see where in cont_ca_sampler you check for the convergence.

Also, could you please let me know what c1 (initial concentration) is about?

Another question: If I downsample Y (spatially and temporally) before doing greedyROI, the resulting Ain and Cin will be as well downsampled. What is your recommendation for estimating the full A and C before proceeding to update_spatial_components and update_temporal_components sections of the code?

@farznaj

Could you please let me know how you check for the convergence, i.e. where does it happen in cont_ca_sampler?

cont_ca_sampler is a MCMC method and convergence is conceptually different. Convergence in MCMC means that you get samples from the true posterior of the spike times (and the rest of the parameters) given the data. The samples you get will always be variable which is a good thing because it means they explore the posterior distribution. Convergence diagnostics for MCMC are not examined here but with the number of samples that we draw, we can be fairly confident that the chain has converged

Also, could you please let me know what c1 (initial concentration) is about?

This is the value of the concentration at time t = 1. It has only a decay time constant, trying to model any spikes that may have occurred just before we started recording

@farznaj

Ain, Cin are upsampled to the original dimensions at the end of the initialization procedure

Hi again. I wrote a long question and it disappeared once I hit enter! I am going to write it again. It was about your reply for the convergence in MCMC method. I was wondering if the Ns samples (X) that are drawn in HMC*exact2 are the samples drawn from the posterior of spikes that you mentioned? I see in the codes that you keep the last sample and repeat the procedure (B+Nsamples) times. So it seems overall Ns**(B+Nsamples) samples are drawn from the posterior. Am I understanding this correctly? Is L (inv(Ld + AM'*AM/sg^2)) the posterior distribution? Any intuitive way for why this thing represents the posterior? And I guess mu_post is the mean of the posterior, correct? Also it would be very helpful if you could explain what s_1, G1 and Gs represent since I have seen them in a few parts of the code. I know they are about time constants of the spikes but not sure what they are exactly about: s_1 = sparse(trunc_spikes,1,exp((spiketimes - Dt*trunc_spikes)/tau(1)),T,1); G1 = spdiags(ones(T,1)*[-min(gr),1],[-1:0],T,T); Gs = (-G1sp+G2\s_2(:))/diff(gr);

@farznaj

@farznaj

Ain, Cin are upsampled to the original dimensions at the end of the initialization procedure

Hi again, so I am not sure if I understood your answer. What I was referring to was that in [basis, trace, center, data] = greedyROI2d(data, K, params), assume data is of size 512x512x1000. For computational efficiency I downsample it spatially and temporally to 128x128x500. If I give the downsampled Y to greedyROI, the outputs basis and trace will be of size 128x128xk and 500xk. I don't see anywhere in greedyROI2d that does the upsampling. Am I missing something?

@farznaj

Hi again, so I am not sure if I understood your answer. What I was referring to was that in [basis, trace, center, data] = greedyROI2d(data, K, params), assume data is of size 512x512x1000. For computational efficiency I downsample it spatially and temporally to 128x128x500. If I give the downsampled Y to greedyROI, the outputs basis and trace will be of size 128x128xk and 500xk. I don't see anywhere in greedyROI2d that does the upsampling. Am I missing something?

Maybe we refer to different versions of the code. greedyROI2d doesn't do any downsampling/upsampling. In the latest version of the code, it is included inside initialize_components where, if you want, you can subsampling, followed by greedyROI + some refinement with HALS, followed by upsampling.

@epnev

I see. I will wait for the next release at the end of this month and will then pull them all. Speaking about next release, could you please include in your next release the issue with dealing with complex values of cc as well? Thanks!

I see. I will wait for the next release at the end of this month and will then pull them all. Speaking about next release, could you please include in your next release the issue with dealing with complex values of cc as well? Thanks!