Package qubx :: Package fast :: Module simulate
[hide private]
[frames] | no frames]

Module simulate

source code

Compiled routines for HMM simulation.

Copyright 2008-2014 Research Foundation State University of New York This file is part of QUB Express.

QUB Express is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

QUB Express is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License, named LICENSE.txt, in the QUB Express program directory. If not, see <http://www.gnu.org/licenses/>.

Functions [hide private]
 
simulate(fastmodel, start_states, add_baseline, use_Peq, v_signal, sampling, stimulus_of_seg, Nsample_of_seg, samples_of_seg, on_pct=<__builtin__.function object>, force_Q=False)
Returns independent segments of simulated HMM, as sampled data and as state-idealization.
source code
 
make_idealized_flc(ff, ll, cc, clazz, states, st_counts, f0) source code
 
simulate_baselines(sample_arrays, sampling, baselineFluct, baselineFluctN, baselineFluctLifetime, baselineFluctMaxAmp, baselineDrift, baselineDriftSlope, baselineDriftIntercept, baselinePeriodic, baselinePeriodicFreq, baselinePeriodicPhase, baselinePeriodicAmp, baselineJumps, baselineJumpsAmpStd, baselineJumpsFastW, baselineJumpsFast, baselineJumpsSlow, baselineJumpsLifetime, baselineLGM, baselineLGM2State, baselineLGMProcStd, baselineLGMX0, baselineLGMX0p) source code
Variables [hide private]
  __package__ = 'qubx.fast'
Function Details [hide private]

simulate(fastmodel, start_states, add_baseline, use_Peq, v_signal, sampling, stimulus_of_seg, Nsample_of_seg, samples_of_seg, on_pct=<__builtin__.function object>, force_Q=False)

source code 

Returns independent segments of simulated HMM, as sampled data and as state-idealization.

Parameters:
  • fastmodel - qubx.fast.Model
  • start_states - numpy.array[Nchannel], type int32, of entry state indices, or -1 to pick fresh. On output, contains exit states for sequential simulations.
  • add_baseline - False to skip base amp and std, for adding multi channels
  • v_signal - if nonzero, multiply exc_amp and exc_std by (stimulus[v] - vRev) * 1e-3 (in volts)
  • sampling - interval between samples, in seconds
  • stimulus_of_seg - list[Nseg][Nsignal] of stimulus values or sample arrays. Nsignal > all x in union(L, V). Since 0 indicates 'no stimulus,' stimulus[0] is ignored. Entries should be either a constant (float) or a list or array[nsample] containing a stimulus waveform.
  • nsample - list[Nseg] of number of data points to return
  • samples_of_seg - list[Nseg] of array[Nsample_of_seg[i]] of float32, will be filled with output
  • on_pct - callback function on_pct(frac), 0 <= frac <= 1. Return nonzero to stop the simulation.
  • force_Q - uses Q matrix method (instead of A matrix) even if it would be slower
Returns:
(states as numpy.array[Nevent] of int32, counts as numpy.array[Nevent] of int32, amp, std as numpy.array[Nevent] of float64)