mobeets / nullSpaceControl

1 stars 0 forks source link

account for non-physiological predictions #244

Closed mobeets closed 8 years ago

mobeets commented 8 years ago

i.e., no predictions in latent space require spikes above 100 (e.g.) or below 0 for any neuron

talk to Matt about linear program to find if latent value is generatable without negative firing or too large firing Steve: bound all spikes with 0 and, e.g., 100 spikes

mobeets commented 8 years ago

i predict the same, but when scoring, i only score the latent predictions at timepoints where the spikes that would produce those latents (i.e., solving for latents given the spikes would reproduce the latents) are all above 0 and below 50.

note that around 20% of the observed latents would fail this test. but habitual fails about 35% and unconstrained around 45%.

anyway, this makes unconstrained about at the level of habitual, in terms of the mean.

screen shot 2016-08-01 at 11 52 26 am screen shot 2016-08-01 at 11 52 33 am screen shot 2016-08-01 at 11 52 37 am screen shot 2016-08-01 at 11 52 43 am screen shot 2016-08-01 at 11 52 47 am

mobeets commented 8 years ago

the covError appears to be worse for unconstrained though, as expected.

mobeets commented 8 years ago

or if I just check if generative model (diag(sigma)*Lz + mu) mean has non-negative spikes, then this is the percent that are invalid:

true habitual cloud unconstrained [0.1176 0.1133 0.0574 0.2208]

can't evaluate mvncdf for more than 25 dims, so what I can do is see if, wherever it is negative, we can add some percentage of phi to it and get it to be positive.

and if we can add 0.01*phi to make it positive, this only happens for at most 2 neurons at a time, for any hyp.

mobeets commented 8 years ago

screen shot 2016-08-01 at 9 49 20 am

screen shot 2016-08-01 at 9 46 45 am

mobeets commented 8 years ago

see tools.latentsHaveValidSpikes

I find a solution to Eqn 5 above such that u_t is above 0 and below 40 or so

mobeets commented 8 years ago

this ends up saying everything is valid. dang. so to go back what i was doing before: latent is valid if the mean spikes from the generative model are within range.

for each date (rows), here's the percentage is says are invalid:

true     hab   cld   unc   base   min
    12    12     6    22     4   100
    13    17    16    17     0   100
     0     2     1     2     0    100
     1     3     2     5     0   81
     8    11     8    12     0   72
mobeets commented 8 years ago

If instead I use empirical min and max bounds from intuitive block...

true     hab   cld   unc   base   min*
     3    12     3    25     0   100
     4    11     4    18     0   100
     1     6     2    12     0   100
     9    20     6    28     0   100
     5    20     5    33     0   100
mobeets commented 8 years ago

verify (matt seemed suspicious) that matt's approach always finds latents to be valid

mobeets commented 8 years ago

yeah, verified. here's the approach that finds all hypothesis predictions as valid:

for each latent (lts), solves for spikes (sps) such that: A*sps = lts + A*mu s.t. lb <= sps <= ub

i.e., beta*zs = lts where zs = inv(diag(sigma))*(sps - mu) is just the z-scored sps

I think that this succeeds means that most hypotheses are valid in terms of individual spikes, but it's probably breaking the covariances that really makes some hypotheses so bad.

mobeets commented 8 years ago

didn't change much for unconstrained on 20131205:

before (no correction): screen shot 2016-08-08 at 10 17 49 am

after (correcting spikes if the generative model is out of bounds): screen shot 2016-08-08 at 10 23 50 am