示例#1
0
    M = np.outer(m, n) / N
    J = R + M

    ### Simulate

    Z = sim.SimulateActivity(t, sim.GetGaussianVector(0, 1, N), J, I=0)

    # Store

    fac.Store(Z[:, 0:Nsample], 'Z.p', path_here)

else:

    # Retrieve

    Z = fac.Retrieve('Z.p', path_here)

#### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### ####
### Plot

fac.SetPlotParams()

fg = plt.figure()
ax0 = plt.axes(frameon=True)

for i in range(Nsample):
    plt.plot(t, (Z[:, i]), color='0.6')

ax0.spines['top'].set_visible(False)
ax0.spines['right'].set_visible(False)
ax0.yaxis.set_ticks_position('left')
示例#2
0
    fac.Store(mu_s, 'mu_s.p', path_here)
    fac.Store(delta0_s, 'delta0_s.p', path_here)
    fac.Store(delta0I_s, 'delta0I_s.p', path_here)
    fac.Store(mu_c, 'mu_c.p', path_here)
    fac.Store(delta0_c, 'delta0_c.p', path_here)
    fac.Store(deltainf_c, 'deltainf_c.p', path_here)
    fac.Store(delta0I_c, 'delta0I_c.p', path_here)
    fac.Store(deltainfI_c, 'deltainfI_c.p', path_here)
    fac.Store(radius, 'radius.p', path_here)
    fac.Store(outlier, 'outlier.p', path_here)

else:

    # Retrieve

    mu_s = fac.Retrieve('mu_s.p', path_here)
    delta0_s = fac.Retrieve('delta0_s.p', path_here)
    delta0I_s = fac.Retrieve('delta0I_s.p', path_here)
    mu_c = fac.Retrieve('mu_c.p', path_here)
    delta0_c = fac.Retrieve('delta0_c.p', path_here)
    deltainf_c = fac.Retrieve('deltainf_c.p', path_here)
    delta0I_c = fac.Retrieve('delta0I_c.p', path_here)
    deltainfI_c = fac.Retrieve('deltainfI_c.p', path_here)
    radius = fac.Retrieve('radius.p', path_here)
    outlier = fac.Retrieve('outlier.p', path_here)

#### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### ####
### Plot
# We plot K = Mn*phi as first-order statistics and individual variances as second-order statistics

K_s = mu_s / Mm
示例#3
0
#### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### ####
### Import functions

import matplotlib.pyplot as plt
import numpy as np

import fct_simulations as sim
import fct_facilities as fac

#### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### ####
### Load data

path_data = 'Data/'

structure = fac.Retrieve('structure.p', path_data)
activation = fac.Retrieve('activation.p', path_data)
readout = fac.Retrieve('readout.p', path_data)

t = fac.Retrieve('t.p', path_data)
t1 = fac.Retrieve('t1.p', path_data)
t2 = fac.Retrieve('t2.p', path_data)
t3 = fac.Retrieve('t3.p', path_data)

Sii, Siw = fac.Retrieve('ParVec.p', path_data)

m = structure[0]
IA = structure[1]
IB = structure[2]
N = activation.shape[2]
示例#4
0
        ### Compute CENTRAL solution

        mu_s[2,i], delta0_s[2,i], K_s[2,i] = mf.SolveStatic ( ics_2, g, ParVec, backwards = -1. )

    # Store

    fac.Store( K_s, 'K_s.p', path_here)
    fac.Store( mu_s, 'mu_s.p', path_here)
    fac.Store( delta0_s, 'delta0_s.p', path_here)

else:

    # Retrieve

    K_s = fac.Retrieve('K_s.p', path_here)
    mu_s = fac.Retrieve('mu_s.p', path_here)
    delta0_s = fac.Retrieve('delta0_s.p', path_here)


#### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### 
### Plot

fac.SetPlotParams()
dashes = [3, 3] 

color_s = '#4872A1'


# Kappa
# Plot the negative and central branch of the solution only when they are not equal to the positive one
import matplotlib.pyplot as plt
import numpy as np

import fct_simulations as sim
import fct_facilities as fac


#### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### 
### Load data

doCompute = 1

path_data = 'Data/'

structure = fac.Retrieve('structure.p', path_data)
activation = fac.Retrieve('activation.p', path_data)
connectivity = fac.Retrieve('average_connectivity.p', path_data)

N = activation.shape[2]


#### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### 
### Compute PC axis

# We compute the PC axis separately from the Go and the Nogo trials

XA = activation[0,:,:]
XB = activation[1,:,:]

# Z-score
            eig = mf.EigStationary(g, ParVec, [readout[2, i], delta0_cl], p,
                                   pm, pI)
            outlier[2, i] = eig[0]
            radius[2, i] = g * np.sqrt(integ.PrimeSq(0, delta0_cl))

    # Store

    fac.Store(readout, 'readout.p', 'VaryA/')
    fac.Store(outlier, 'outlier.p', 'VaryA/')
    fac.Store(radius, 'radius.p', 'VaryA/')

else:

    # Retrieve

    readout = fac.Retrieve('readout.p', 'VaryA/')
    outlier = fac.Retrieve('outlier.p', 'VaryA/')
    radius = fac.Retrieve('radius.p', 'VaryA/')

#### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### ####
#### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### ####
### Plot

fac.SetPlotParams()
dashes = [3, 3]

#### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### ####
### Readout

fg = plt.figure()
ax0 = plt.axes(frameon=True)