archive-org.com » ORG » C » CHRONUX.ORG

Total: 412

Choose link from "Titles, links and description words view":

Or switch to "Titles and links view".
  • Description of coherencysegpt
    were found 0 otherwise confC confidence level for C at 1 p only for err 1 1 phistd theoretical jackknife depending on err 1 1 err 1 2 standard deviation for phi Note that phi 2 phistd and phi 2 phistd will give 95 confidence bands for phi only for err 1 1 Cerr Jackknife error bars for C use only for Jackknife err 1 2 CROSS REFERENCE INFORMATION This function calls coherencypt Multi taper coherency point process times createdatamatpt Helper function to create an event triggered matrix from a single minmaxsptimes Find the minimum and maximum of the spike times in each channel This function is called by SOURCE CODE 0001 function C phi S12 S1 S2 f zerosp confC phistd Cerr coherencysegpt data1 data2 win params segave fscorr 0002 Multi taper coherency computed by segmenting two univariate point processes into chunks 0003 0004 Usage 0005 C phi S12 S1 S2 f zerosp confC phistd Cerr coherencysegpt data1 data2 win params segave fscorr 0006 Input 0007 Note units have to be consistent See chronux m for more information 0008 data1 1d structure array of spike times also accepts 1d array of spike times required 0009 data2 1d structure array of spike times also accepts 1d array of spike times required 0010 win length of segments required 0011 params structure with fields tapers pad Fs fpass err 0012 optional 0013 tapers precalculated tapers from dpss or in the one of the following 0014 forms 0015 1 A numeric vector TW K where TW is the 0016 time bandwidth product and K is the number of 0017 tapers to be used less than or equal to 0018 2TW 1 0019 2 A numeric vector W T p where W is the 0020 bandwidth T is the duration of the data and p 0021 is an integer such that 2TW p tapers are used In 0022 this form there is no default i e to specify 0023 the bandwidth you have to specify T and p as 0024 well Note that the units of W and T have to be 0025 consistent if W is in Hz T must be in seconds 0026 and vice versa Note that these units must also 0027 be consistent with the units of params Fs W can 0028 be in Hz if and only if params Fs is in Hz 0029 The default is to use form 1 with TW 3 and K 5 0030 0031 pad padding factor for the FFT optional can take values 1 0 1 2 0032 1 corresponds to no padding 0 corresponds to padding 0033 to the next highest power of 2 etc 0034 e g For N 500 if PAD 1 we do not pad if PAD 0 we pad the FFT 0035 to 512 points if pad 1 we pad to 1024 points etc 0036 Defaults to 0 0037 Fs sampling frequency optional Default 1 0038 fpass frequency band to be used in the calculation in the form

    Original URL path: http://www.chronux.org/Documentation/chronux/spectral_analysis/pointtimes/coherencysegpt.html (2015-03-27)
    Open archived version from archive


  • Description of fig8_3
    only Versicolor and Virginica are used in this example The Species variable contains species names Specn has them numerically Setosa 1 Versicolor 2 Virginica 3 Author Catherine Loader Need get contour plot correct Need distinguish colors in plot CROSS REFERENCE INFORMATION This function calls This function is called by runbook SOURCE CODE 0001 Local Regression and Likelihood Figure 8 3 0002 0003 Discrimination Classification iris data for different 0004 smooting paramters 0005 0006 Note that the iris mat file contains the full iris dataset 0007 only Versicolor and Virginica are used in this example 0008 0009 The Species variable contains species names Specn has 0010 them numerically Setosa 1 Versicolor 2 Virginica 3 0011 0012 Author Catherine Loader 0013 0014 Need get contour plot correct 0015 Need distinguish colors in plot 0016 0017 load iris 0018 a 2 9 10 0019 z zeros size a 0020 0021 u find Specn 2 0022 pw PetalWid u 0023 pl PetalLen u 0024 y Specn u 3 0025 0026 for i 1 length a 0027 fit locfit pw pl y deg 1 alpha a i ev cros scale 0 family binomial 0028 fv fitted fit 0029 tb tabulate 10 y fv 0 5

    Original URL path: http://www.chronux.org/Documentation/chronux/locfit/Book/fig8_3.html (2015-03-27)
    Open archived version from archive

  • Description of mtspectrumc_unequal_length_trials
    of Fs If Fs 1 ie normalized 0018 then window winstep should be in samples or else if Fs is 0019 unnormalized then they should be in time secs 0020 sMarkers N x 2 array of segment start stop marks sMarkers n 1 start 0021 sample index sMarkers n 2 stop sample index for the nth segment 0022 params see Chronux help on mtspecgramc 0023 0024 Output 0025 0026 S frequency x channels 0027 f frequencies x 1 0028 Serr error bars only for err 1 1 0029 0030 0031 0032 iwAvg 1 0 no weighted average 1 weighted average 0033 debug 0 will display intermediate calcs 0034 0035 if nargin 2 error Unequal length trials Need data and window parameters end 0036 if nargin 3 params end 0037 if isempty sMarkers error Unequal length trials Need Markers end 0038 tapers pad Fs fpass err trialave params getparams params 0039 if nargout 2 err 1 0 0040 Cannot compute error bars with err 1 0 change params and run again 0041 error Unequal length trials When Serr is desired err 1 has to be non zero 0042 end 0043 0044 Set moving window parameters to no overlapping 0045 if abs movingwin 2 movingwin 1 1e 6 disp avgSpectrum Warming Window parameters for averaging should be non overlapping Set movingwin 2 movingwin 1 end 0046 0047 wLength round Fs movingwin 1 number of samples in window 0048 wStep round movingwin 2 Fs number of samples to step through 0049 0050 Check whether window lengths satify segment length NW 2 0051 if wLength 2 tapers 1 error avgSpectrum movingwin 1 2 tapers 1 end 0052 0053 Left align segment markers for easier coding 0054 sM ones size sMarkers 1 2 0055 sM 2 sMarkers 2 sMarkers 1 1 0056 0057 min max segments 0058 Nmax max sM 2 Nmin min sM 2 0059 if Nmin 2 tapers 1 error avgSpectrum Smallest segment length 2 tapers 1 Change taper settings end 0060 0061 max time sample length will be the window length 0062 nfft 2 nextpow2 wLength pad 0063 f findx getfgrid Fs nfft fpass 0064 0065 Precompute all the tapers 0066 sTapers tapers 0067 sTapers dpsschk sTapers wLength Fs compute tapers for window length 0068 0069 nChannels size data 2 0070 nSegments size sMarkers 1 0071 0072 if debug 0073 disp Window Length num2str wLength 0074 disp Window Step num2str wStep 0075 disp 0076 end 0077 0078 s zeros length f nChannels 0079 serr zeros 2 length f nChannels 0080 S zeros length f nChannels 0081 Serr zeros 2 length f nChannels 0082 nWins 0 0083 for sg 1 nSegments 0084 Window lengths steps fixed above 0085 For the given segment compute the positions number of windows 0086 N sM sg 2 0087 wStartPos 1 wStep N wLength 1 0088 nWindows length wStartPos 0089 if nWindows 0090 nWins nWins nWindows for averaging purposes 0091 0092 w zeros nWindows 2 0093 for n 1 nWindows 0094 w n wStartPos n wStartPos n wLength

    Original URL path: http://www.chronux.org/Documentation/chronux/spectral_analysis/continuous/mtspectrumc_unequal_length_trials.html (2015-03-27)
    Open archived version from archive

  • Description of testAvg3
    for testing purposes 0058 f1 0 45 a1 0 20 0059 f2 0 25 a2 0 15 0060 for c 1 size fulldata 2 0061 mx max fulldata c 0062 fulldata c fulldata c a1 mx sin f1 2 pi 1 size fulldata 1 a2 mx sin f2 2 pi 1 size fulldata 1 0063 end 0064 end 0065 0066 0067 Randomly select a few channels 0068 0069 chIndices sort myrandint ceil nChannels 1 5 1 1 nChannels noreplace 0070 chIndices 1 nChannels 0071 0072 0073 Create a data matrix with all the segments aligned one after another 0074 0075 totalSegmentLength sum sMarkers 2 sMarkers 1 1 0076 data zeros totalSegmentLength length chIndices preallocate to ensure contiguous memory 0077 newMarkers 1 1 1 0078 newMarkers 1 2 sMarkers 1 2 sMarkers 1 1 1 0079 data newMarkers 1 1 newMarkers 1 2 fulldata sMarkers 1 1 sMarkers 1 2 chIndices 0080 for sg 2 size sMarkers 1 0081 newMarkers sg 1 newMarkers sg 1 2 1 0082 newMarkers sg 2 newMarkers sg 1 sMarkers sg 2 sMarkers sg 1 0083 data newMarkers sg 1 newMarkers sg 2 fulldata sMarkers sg 1 sMarkers sg 2 chIndices 0084 end 0085 0086 To ensure that we check results from array indices beyond 1 0087 if nChannels 1 0088 ix sort myrandint 1 2 1 length chIndices noreplace Arbitrarily pick two indices from selected channels for testing results 0089 i1 ix 1 i2 ix 2 0090 iC m n 1 n 2 2 for elements of the the coherence matrix Cmn 0091 iC ix 1 ix 2 1 ix 2 2 2 0092 else 0093 ix sort myrandint 1 1 1 length chIndices noreplace Arbitrarily pick 1 indices from selected channels for testing results 0094 i1 ix 1 0095 end 0096 0097 0098 Power spectrum spectrogram coherence coherogram 0099 0100 if gram 0 0101 S f Serr ueSpectrogram data movingwin params newMarkers 0102 figure plotvector S i1 f l squeeze Serr i1 0103 figure plot f 10 log10 S i1 title Avg Routine Spectrum 0104 elseif gram 1 0105 Cmn Phimn Smn Smm f I ConfC PhiStd Cerr ueCoherence data params newMarkers 0106 C i j Cmn k where k j 1 2 i 1 i 2 0107 figure plot f 10 log10 Cmn iC title Avg Routine Coherence Magnitude 0108 figure plot f phimn iC title Avg Routine Coherence Phase 0109 disp Confidence levelfor C confC at 1 p level num2str ConfC iC 0110 end 0111 0112 0113 Use to check against Chronux only for equal length segments 0114 0115 if chronux 0116 cdata repmat fulldata sMarkers 1 1 sMarkers 1 2 chIndices i1 1 nSegments round nSamples 2 x nSegments 0117 params trialave 1 0118 if gram 0 0119 cS cf cSerr mtspectrumc cdata params 0120 figure plot cf 10 log10 cS title Chronux Spectrum 0121 figure plot cf 10 log10 cSerr 1 cf 10 log10 cSerr 2 title Chronux Error Bar Computations 0122 figure plot cf 10 log10 cS 10 log10

    Original URL path: http://www.chronux.org/Documentation/chronux/test/testAvg3.html (2015-03-27)
    Open archived version from archive

  • Description of coherr
    0013 numsp1 number of spikes for data1 supply only if finite size corrections are required 0014 numsp2 number of spikes for data2 supply only if finite size corrections are required 0015 0016 Outputs 0017 confC confidence level for C only for err 1 1 0018 phistd theoretical or jackknife standard deviation for phi for err 1 1 and err 1 2 0019 respectively returns zero if coherence is 1 0020 Cerr Jacknife error bars for C only for err 1 2 0021 Jackknife uses the following transform of the coherence 0022 z sqrt 2 dim 2 atanh C Asymptotically and for Gaussian data var z 1 0023 0024 if nargin 5 error Need at least 5 input arguments end 0025 if err 1 0 error Need err 1 p or 2 p for error bar calculation end 0026 if nargout 4 err 1 1 error Cerr contains Jackknife errors only computed when err 1 is 2 end 0027 nf K Ch size J1 0028 errchk err 1 0029 p err 2 0030 pp 1 p 2 0031 0032 Find the number of degrees of freedom 0033 0034 if trialave 0035 dim K Ch 0036 dof 2 dim 0037 dof1 dof 0038 dof2 dof 0039 Ch 1 0040 if nargin 6 isempty numsp1 0041 totspikes1 sum numsp1 0042 dof1 fix 2 totspikes1 dof 2 totspikes1 dof 0043 end 0044 if nargin 7 isempty numsp2 0045 totspikes2 sum numsp2 0046 dof2 fix 2 totspikes2 dof 2 totspikes2 dof 0047 end 0048 dof min dof1 dof2 0049 J1 reshape J1 nf dim 0050 J2 reshape J2 nf dim 0051 else 0052 dim K 0053 dof 2 dim 0054 dof1 dof 0055 dof2 dof 0056 for ch 1 Ch 0057 if nargin 6 isempty numsp1 0058 totspikes1 numsp1 ch 0059 dof1 fix 2 totspikes1 dof 2 totspikes1 dof 0060 end 0061 if nargin 7 isempty numsp2 0062 totspikes2 numsp2 ch 0063 dof2 fix 2 totspikes2 dof 2 totspikes2 dof 0064 end 0065 dof ch min dof1 dof2 0066 end 0067 end 0068 0069 variance of the phase 0070 0071 0072 Old code is the next few lines new code is in the if statement below 0073 beginning line 87 0074 0075 if isempty find C 1 2 10 16 0076 phierr sqrt 2 dof ones nf 1 1 C 2 1 0077 else 0078 phierr zeros nf Ch 0079 end 0080 0081 0082 theoretical asymptotic confidence level 0083 0084 if dof 2 0085 confC 1 0086 else 0087 df 1 dof 2 1 0088 confC sqrt 1 p df 0089 end 0090 0091 Phase standard deviation theoretical and jackknife and jackknife 0092 confidence intervals for C 0093 0094 if errchk 1 0095 totnum nf Ch 0096 phistd zeros totnum 1 0097 CC reshape C totnum 1 0098 indx find abs CC 1 1 e 16 0099 dof repmat dof nf 1 0100 dof reshape dof totnum 1 0101 phistd indx sqrt 2 dof indx 1 C indx 2 1 0102 phistd reshape phistd nf

    Original URL path: http://www.chronux.org/Documentation/chronux/spectral_analysis/helper/coherr.html (2015-03-27)
    Open archived version from archive

  • Description of fig9_1
    script file DESCRIPTION Local Regression and Likelihood Figure 9 1 Hardle s Motorcycle accelaration dataset Just a scatterplot Author Catherine Loader CROSS REFERENCE INFORMATION This function calls This function is called by runbook SOURCE CODE 0001 Local Regression and Likelihood Figure 9 1 0002 0003 Hardle s Motorcycle accelaration dataset Just a scatterplot 0004 0005 Author Catherine Loader 0006 0007 load mcyc 0008 figure Name fig9 1 motorcycle scatterplot 0009

    Original URL path: http://www.chronux.org/Documentation/chronux/locfit/Book/fig9_1.html (2015-03-27)
    Open archived version from archive

  • Description of mtspectrumpb
    1 fpass frequency band to be used in the calculation in the form fmin fmax optional Default all frequencies between 0 and Fs 2 err error calculation 1 p Theoretical error bars 2 p Jackknife error bars 0 p or 0 no error bars optional Default 0 trialave average over channels trials when 1 don t average when 0 optional Default 0 fscorr finite size corrections 0 don t use finite size corrections or 1 use finite size corrections optional available only for spikes Defaults 0 Output S spectrum in form frequency x channels trials if trialave 0 as a function of frequency if trialave 1 f frequencies R spike rate Serr error bars only for err 1 1 CROSS REFERENCE INFORMATION This function calls mtfftpb Multi taper fourier transform binned point process data This function is called by mtspecgrampb Multi taper time frequency spectrum binned point process mtspectrumtrigpb Multi taper event triggered time frequency spectrum binned point process SOURCE CODE 0001 function S f R Serr mtspectrumpb data params fscorr 0002 Multi taper spectrum binned point process 0003 0004 Usage 0005 0006 S f R Serr mtspectrumpb data params fscorr 0007 Input 0008 data in form samples x channels trials or a single vector required 0009 params structure with fields tapers pad Fs fpass err trialave 0010 optional 0011 tapers precalculated tapers from dpss or in the one of the following 0012 forms 0013 1 A numeric vector TW K where TW is the 0014 time bandwidth product and K is the number of 0015 tapers to be used less than or equal to 0016 2TW 1 0017 2 A numeric vector W T p where W is the 0018 bandwidth T is the duration of the data and p 0019 is an integer such that 2TW p tapers are used In 0020 this form there is no default i e to specify 0021 the bandwidth you have to specify T and p as 0022 well Note that the units of W and T have to be 0023 consistent if W is in Hz T must be in seconds 0024 and vice versa Note that these units must also 0025 be consistent with the units of params Fs W can 0026 be in Hz if and only if params Fs is in Hz 0027 The default is to use form 1 with TW 3 and K 5 0028 0029 pad padding factor for the FFT optional can take values 1 0 1 2 0030 1 corresponds to no padding 0 corresponds to padding 0031 to the next highest power of 2 etc 0032 e g For N 500 if PAD 1 we do not pad if PAD 0 we pad the FFT 0033 to 512 points if pad 1 we pad to 1024 points etc 0034 Defaults to 0 0035 Fs sampling frequency optional Default 1 0036 fpass frequency band to be used in the calculation in the form 0037 fmin fmax optional 0038 Default all frequencies between 0

    Original URL path: http://www.chronux.org/Documentation/chronux/spectral_analysis/pointbinned/mtspectrumpb.html (2015-03-27)
    Open archived version from archive

  • Description of testAvg4
    nChannels 1 round hdr nChans 4 round 3 hdr nChans 4 noreplace 0068 chIndices 3 3 nChannels 1 0069 else 0070 chIndices 10 10 nChannels 1 0071 chIndices 3 7 0072 end 0073 0074 0075 Randomly generate the time series 0076 0077 fulldata eegMex dir xfile chIndices 1 hdr nSamples 50 1 0078 mDiscardBits 0 0079 conversionFactor 8711 2 21 0 5 2 mDiscardBits 0080 fulldata fulldata conversionFactor 0081 0082 0083 Create a data matrix with all the segments aligned one after another 0084 0085 totalSegmentLength sum sMarkers 2 sMarkers 1 1 0086 data zeros totalSegmentLength length chIndices preallocate to ensure contiguous memory 0087 newMarkers 1 1 1 0088 newMarkers 1 2 sMarkers 1 2 sMarkers 1 1 1 0089 data newMarkers 1 1 newMarkers 1 2 detrend fulldata 1 sMarkers 1 1 sMarkers 1 2 0090 for sg 2 size sMarkers 1 0091 newMarkers sg 1 newMarkers sg 1 2 1 0092 newMarkers sg 2 newMarkers sg 1 sMarkers sg 2 sMarkers sg 1 0093 data newMarkers sg 1 newMarkers sg 2 detrend fulldata 1 sMarkers sg 1 sMarkers sg 2 0094 end 0095 0096 To ensure that we check results from array indices beyond 1 0097 if nChannels 1 0098 ix sort myrandint 1 2 1 length chIndices noreplace Arbitrarily pick two indices from selected channels for testing results 0099 i1 ix 1 i2 ix 2 0100 iC m n 1 n 2 2 for elements of the the coherence matrix Cmn 0101 iC ix 1 ix 2 1 ix 2 2 2 0102 else 0103 ix sort myrandint 1 1 1 length chIndices noreplace Arbitrarily pick 1 indices from selected channels for testing results 0104 i1 ix 1 0105 end 0106 0107 0108 Power spectrum spectrogram coherence coherogram 0109 0110 if gram 0 0111 S f Serr avgSpectrum data movingwin params newMarkers 0112 figure plot f 10 log10 S i1 k f 10 log10 Serr 2 i1 g f 10 log10 Serr 1 i1 g title Avg Routine Spectrum 0113 figure plot f 10 log10 S i1 title Avg Routine Spectrum 0114 elseif gram 1 0115 Cmn Phimn Smn Smm f ConfC PhiStd Cerr avgCoherence data movingwin params newMarkers 0116 C i j Cmn k where k j 1 2 i 1 i 2 0117 figure plot f Cmn iC k f Cerr 2 iC g f Cerr 1 iC g 0118 title Avg Routine Coherence ylim 0 1 0119 figure plot f 10 log10 Cmn iC title Avg Routine Coherence Magnitude 0120 figure plot f phimn iC title Avg Routine Coherence Phase 0121 disp Confidence level for C confC at 1 p level num2str ConfC iC 0122 end 0123 0124 0125 0126 0127 Use to check against Chronux only for equal length segments 0128 0129 if chronux 0130 0131 win floor newMarkers 1 2 movingwin 1 0132 newMarkers 1 2 newMarkers 1 2 mod newMarkers 1 2 win 0133 cdata data 1 newMarkers 1 2 i1 0134 cdata detrend reshape cdata newMarkers 1 2 win win

    Original URL path: http://www.chronux.org/Documentation/chronux/test/testAvg4.html (2015-03-27)
    Open archived version from archive



  •