Software Appendix
for
Wiener Transfer Functions



Robert Kessel
Code 8123
Naval Research Laboratory

kessel@ncst.nrl.navy.mil



November 4, 2003

Abstract

This appendix provides links to the IDL routines and supporting functions used to extract and use Wiener filter estimates for the transfer function.

Key words: transfer function, Wiener filters, behavioral dynamics, linear systems analysis, Monte Carlo, pigeons.


Software Appendix for Wiener Transfer Functions





This appendix follows an IDL batch processing script that first extracts a Wiener filter transfer function from data collected during a measurement phase (phase 3) and then predict the behavior on a test phase (phase 4). The processing script itself is at b558_analysis.bat. (Any text shown in with a tt font are filenames, pathnames, or IDL variables, listings segments, or command lines.) The data used are for Bird 558 from JSU's E42 experiment and can be obtained from Palya et al.'s (2002) web appendix. The processing script assumes that the data files are located in a subdirectory named bird_558.



The first several lines of the batch processing script just set filenames and some control variables so the Phase 3 data can be read in for processing:

file_path = ':bird_558:'

r_in_file = 'b558_p3_input.txt'
r_in_vari_file = 'b558_p3_input_var.txt'
b_out_file = 'b558_p3_output.txt'
b_out_vari_file = 'b558_p3_output_var.txt'

n_t_funs = 4096
seed = 2866595l

ndata = 256
trial = 2000.



The next several lines of the script begin with the function call to monte_carlo_wien_t_fun.pro which actually generates the Wiener filter transfer function. The results are saved and then plotted first to the screen and then to a postscript file.

monte_wien_t_fun = monte_carlo_wien_t_fun(file_path, r_in_file, r_in_vari_file, $
b_out_file, b_out_vari_file, n_t_funs, seed)
;
SAVE, monte_wien_t_fun, FILENAME = file_path+'b558_monte_wien_t_fun.dat'
;
plot_t_fun, ndata, trial, monte_wien_t_fun, $
'Bird 558, Phase 3 Monte Carlo Wiener tranfer function', file_path, $
'b558_monte_wien_t_fun.ps'
plot_t_fun_ps, ndata, trial, monte_wien_t_fun, $
'Bird 558, Phase 3 Monte Carlo Wiener tranfer function', file_path, $
'b558_monte_wien_t_fun.ps'

The function monte_carlo_wien_t_fun.pro is, in turn, supported by:

The two plot utilities plot_t_fun.pro and plot_t_fun_ps.pro then display the transfer function.



The balance of the processing script first sets the control variables to read Phase 4 data and then makes two predictions using the program predict_from_t_fun.pro:
Finally, two plotting programs display the measured rate data and both predictions for the response rate.

; phase 4
r_in_file = 'b558_p4_input.txt'
r_in_vari_file = 'b558_p4_input_var.txt'
b_out_file = 'b558_p4_output.txt'
b_out_vari_file = 'b558_p4_output_var.txt'

; restore the original E42 transfer function for a comparison
e42_conj_t_fun_alt = CONJ(read_256_t_fun('b558_tfun_v1_p3.dat'))
;
predict_from_t_fun, file_path, r_in_file, r_in_vari_file, b_out_file, $
b_out_vari_file, e42_conj_t_fun, times, b_out, b_out_vari, b_out_pred
b_out_pred_simp = FLOAT(b_out_pred)
;
predict_from_t_fun, file_path, r_in_file, r_in_vari_file, b_out_file, $
b_out_vari_file, monte_wien_t_fun, times, b_out, b_out_vari, b_out_pred
b_out_pred_wein = FLOAT(b_out_pred)
;
plot_predict_v3, ndata, times, b_out, b_out_vari, b_out_pred_simp, $
b_out_pred_wein, 558, 4, file_path
plot_predict_v3_ps, ndata, times, b_out, b_out_vari, b_out_pred_simp, $
b_out_pred_wein, 558, 4, file_path

Note the use of IDL's FLOAT function to force the results back into a real array. As a practical matter, the transformation of the arrays into reals has little effect. Both the original E42 transfer function and the Wiener transfer function are Hermitian so the predicted behavior, while complex, actually only has real components. The imaginary components are all essentially zero within machine precision. The two plot utilities plot_predict_v3.pro and plot_predict_v3_ps.pro call the supporting routine and function eval_chi_sqrd_nu.pro and q_chi_sqrd_nu.pro to evaluate the reduced chi-square.


Date last modified: 4 Nov 2003, 11:45