function phi_kk = plot_SPACF(r_k,n) % PLOT_PSACF - Plots the partial sample autocorrelation function with 2*sigma error bars % % Input: % r_k : the sample autocorrelation functions % n: the number of data samples that went into computing r_k the sample autocorrelations % Output: % phi_kk : the partial sample autocorrelations % % Written by: % -- % John L. Weatherwax 2009-04-21 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- %addpath( '../' ); phi_kk = spacf(r_k); n_k = length(phi_kk); sf=figure; sh_ind=stem( 1:n_k, phi_kk, 'bx', 'linewidth', 2 ); hold on; xlabel( 'lag (k)' ); ylabel( 'sample partial autocorrelation \phi_{kk}' ); axis tight; % plot the value of the standard errors of the sample autocorrelations: se_r_k = sqrt(1/n); figure(sf); hold on; plot( 1:n_k, -1.97 * se_r_k * ones(1,n_k), 'r-' ); figure(sf); hold on; plot( 1:n_k, +1.97 * se_r_k * ones(1,n_k), 'r-' ); %axis tight; axis( [ 0, n_k-0.5, -Inf, +Inf ] ); return;