Numerically solvable exercises and corresponding matlab-code (Problem number as in the book Statistical Physics by J. Honerkamp.):
| Problem number | Problem | Matlab-code |
| 9.2 | Simulate a time series, say, an AR(2) process (see Sect. 5.9.4, example 3) of N=1024 data points, and determine the absolute values and phases of the Fourier transform. Replace the phases by random values, equally distributed in [0,2*pi], and subject to the constraint derived in Sect. 9.1, so that the time series, obtained by the inverse Fourier transform, is real. What a meaning has this time series? | fgsurrogate.m |
| 9.3 | Generate three AR(2) processes (see Sect. 5.9.4), each of length 4098 and with damping rate 200, and with period 5,10, and 30 respectively. Concatenate these time series and determine the time-dependent spectrogram of the result. Furthermore: Record some spoken words or other sounds and discuss the time-dependent spectrograms. | threear2.m |
| 9.4 | Generate a harmonic wave with 8 and with 8.5 cycles within 1024 data points. Calculate the periodogram and visualize it. Why do the second periodogram show sidelobes, the first one from a time series with a whole number of cycles not? Interpret the time series as a multiplication of an infinite time series and a boxcar window, and calculate the Fourier transform of it as the convolution of the Fourier transforms of the factors. | sidelobes.m |
| 10.1 | Write a program, by which, for a given realization of an AR(2) process, the parameters of the model are estimated with the Monte Carlo Markov Chain method as explained in Sect. 10.3. Generate the sample by simulating an AR(2) model with period T=20 and damping rate tau=50 (see Sect. 5.9.4, example 3). | fgmc2arma.m |
| 10.2 | Estimate coefficients and frequency of a model y(t)= a1*sin(f*t) + a2*cos(f*t)+sigma*eta(t), with eta(t)~WN(0,1). Use the Gibbs sampler for the estimation of the coefficients a1,a2, and the Metropolis-Hastings method for the estimation of the frequency f. | mc2onefrequ.m |
| 11.2 | Generate a random NxM matrix and construct from it, by manipulating the singular values, a well-conditioned and an ill-conditioned matrix K(i,j). Use these matrices to define a linear regression model, simulate data by choosing some parameters and try to estimate these parameters, given the simulated data. Study the estimates and their confidence intervals in dependence on the condition of the matrix K(i,j). | fgilltest.m |
| 11.3 | Simulate a hidden Markov model and apply the Viterbi algorithm to the observations {y(t), t=1,...,N}. Calculate the estimate based on {y(t'), t'=1,...,t} and the estimate based on {y(t'), t'=1,...,N}. | fgviterbi.m |
| 11.4 | Write a subroutine for a Kalman filter and a state space model (for a univariate variables x and y only) and use these to show that for the observation equation y(t)=x(t) + epsilon(t) the Kalman filter estimate is, for given {y(t), t=1,...,N}, a better approximation to {x(t), t=1,...,N} than the naive simple estimate {y(t), t=1,...,N}. | fgkalman.m |
| 12.1 | Formulate a hidden Markov model with two hidden states, simulate some data points, and estimate the parameters, given the data. | fgestprmhmm.m |
| 12.2 | A casino manager uses from time to time an unfair die, so the casino can be in two different states (fair die, unfair die). Observable are only the points after each throw. Formulate a hidden Markov model for this situation. Simulate data and estimate the parameters of the model, given the data. Plot the probability, in dependence of time, that the casino is in the unfair state. | hmmcasino.m |
| 13.1 | For the test statistic 'mean' the standard deviation can also be estimated analytically. Use normally distributed random numbers with zero mean and standard deviation equal 2 as data and determine the bootstrap results for mean and standard deviation. Vary the size of the bootstrap sample from 50 to 500 and compare the results. | boottest.m (uses bootstrp.m from Matlab Statistics Toolbox) |
| 13.2 | Two different sorts of scripts can be generated in the following way: One defines a vocabulary, e.g., the numbers from 1 to 10 and for every sort a different probability distributions for every word of the vocabulary. Given a collection of n1 scripts of sort 1 and n2 scripts of sort 2, estimate the probability of each word of each sort (learning with teacher). Use the Bayes' classificator to determine to which sort newly generated scripts belong. Try to apply this method to realistic scripts. | textclass.m |
| 13.3 | Write a program for estimating with the help of the EM algorithm the mean and standard deviation of three clusters of normally distributed random two-dimensional data. | emclass.m. |