diff --git a/projects/project_numbers/Makefile b/projects/project_numbers/Makefile new file mode 100644 index 0000000..dad25ce --- /dev/null +++ b/projects/project_numbers/Makefile @@ -0,0 +1,10 @@ +latex: + pdflatex *.tex > /dev/null + pdflatex *.tex > /dev/null + +clean: + rm -rf *.log *.aux *.zip *.out auto + rm -f `basename *.tex .tex`.pdf + +zip: latex + zip `basename *.tex .tex`.zip *.pdf *.dat *.mat diff --git a/projects/project_numbers/Neuron22.mat b/projects/project_numbers/Neuron22.mat new file mode 100644 index 0000000..a4f0bda Binary files /dev/null and b/projects/project_numbers/Neuron22.mat differ diff --git a/projects/project_numbers/numbers.tex b/projects/project_numbers/numbers.tex new file mode 100755 index 0000000..51312ef --- /dev/null +++ b/projects/project_numbers/numbers.tex @@ -0,0 +1,60 @@ +\documentclass[addpoints,10pt]{exam} +\usepackage{url} +\usepackage{color} +\usepackage{hyperref} + +\pagestyle{headandfoot} +\runningheadrule +\firstpageheadrule +\firstpageheader{Scientific Computing}{Project Assignment}{11/05/2014 + -- 11/06/2014} +%\runningheader{Homework 01}{Page \thepage\ of \numpages}{23. October 2014} +\firstpagefooter{}{}{} +\runningfooter{}{}{} +\pointsinmargin +\bracketedpoints + +%\printanswers +%\shadedsolutions + + +\begin{document} +%%%%%%%%%%%%%%%%%%%%% Submission instructions %%%%%%%%%%%%%%%%%%%%%%%%% +\sffamily +% \begin{flushright} +% \gradetable[h][questions] +% \end{flushright} + +\begin{center} + \input{../disclaimer.tex} +\end{center} + +%%%%%%%%%%%%%% Questions %%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{questions} + \question The accompanying data {\tt Neuron22.mat} stores a single + data matrix {\tt data\_unsorted} containing spike from a neuron in + macaque prefrontal cortex. The task of the monkey was to + discriminate point sets with 1 to 4 points. The first column + contains the number of points shown plus one. The remaining columns + contain the spike response across 1300ms. During the first 500ms the + monkey was fixating a target. The next 800ms the stimulus was + shown. This was followed by 1000ms delay time before the monkey was + allowed to respond. + + \begin{parts} + \part Plot the data in an appropriate way. + \part Sort the trials according to the stimulus presented and + compute the firing rate (in Hz) in the time interval + 500-1300ms. Plot the firing rate in an appropriate way. + \part Use an appropriate test to determine whether the firing rate + in that interval is significantly different for 1 vs. 4 points + shown. + \end{parts} +\end{questions} + + + + + +\end{document} diff --git a/projects/project_spectra/spectra.tex b/projects/project_spectra/spectra.tex index 61f2e1a..1526b9a 100755 --- a/projects/project_spectra/spectra.tex +++ b/projects/project_spectra/spectra.tex @@ -32,7 +32,26 @@ %%%%%%%%%%%%%% Questions %%%%%%%%%%%%%%%%%%%%%%%%% \begin{questions} - \question What was the questions for 42? + \question The accompanying file contains ten stimulus and response + sequences of a P-Unit of a weakly electric fish {\em Apteronotus + leptorhynchus}. Another matrix contains the corresponding {\em + electric organ discharge (EOD)} of the fish. The sampling rate is + 100kHz. + \begin{parts} + \part Split the data in non-overlapping 200ms windows and plot + them in an appropriate way. + \part Compute the autocorrelation of the spike response as well as + the cross-correlation between stimulus and spike response. + \part Determine the fundamental stimulus frequency and the EOD + frequency using a Fourier transform. + \part Convolve the spike responses (windows) with a Gaussian of + appropriate size and compute the average Fourier amplitude + spectrum of the spike response. Plot the result in an appropriate + way. + \part Determine whether you can find peas in the amplitude + spectrum at the fundamental frequency of the EOD and/or the + stimulus and/or their difference. + \end{parts} \end{questions} diff --git a/statistics/lecture_statistics02.tex b/statistics/lecture_statistics02.tex index 42586d1..dfa26d9 100644 --- a/statistics/lecture_statistics02.tex +++ b/statistics/lecture_statistics02.tex @@ -369,12 +369,12 @@ incubation. The following plot depicts the mean thymus gland weights in (mg): the the first $80$ datapoints, and repeat the following steps $m=500$ times: \begin{enumerate} - \item draw $50$ data points from $x$ with replacement + \item draw $80$ data points from $x$ with replacement \item compute their mean and store it \end{enumerate} Look at the standard deviation of the computed means. \item Compare the result to the standard deviation of the original - $50$ data points and the standard error. + $80$ data points and the standard error. \end{itemize} \end{task} \end{frame} diff --git a/statistics/matlab/invg_loglikelihood.m b/statistics/matlab/invg_loglikelihood.m index 5460ea4..75e3325 100644 --- a/statistics/matlab/invg_loglikelihood.m +++ b/statistics/matlab/invg_loglikelihood.m @@ -1,4 +1,5 @@ function ll = invg_loglikelihood(x, p) mu = p(1); lambda = p(2); - ll = mean(.5*(log(lambda) - log(2*pi) - 3*log(x)) - lambda*(x-mu).^2./(2*mu^2*x)); \ No newline at end of file + ll = .5*(log(lambda) - log(2*pi) - 3*log(x)) - ... + lambda*(x-mu).^2./(2*mu^2*x); \ No newline at end of file diff --git a/statistics/matlab/lserr.m b/statistics/matlab/lserr.m index f54221f..6ff2bc3 100644 --- a/statistics/matlab/lserr.m +++ b/statistics/matlab/lserr.m @@ -1,4 +1,4 @@ -function [err, grad] = lserr(param, x, y) +function [err, grad] = lserr(x, y, param) err = mean( (param(1)*x + param(2) - y).^2 ); if nargout == 2