MATCH_RATE Redraw samples to match spike rate
usage: [X_out] = match_rate(X_in, R_samples, R);
arguments: X_in -- Nx1 samples from distribution of
estimated entropy rates
R_in -- Nx1 samples of spike rates associated with
entropy rate estimates.
R -- center (mean) spike rate
outputs: X_out -- samples of X_in adjusted to spike rate
This function presumes a linear Ansatz between entropy rate and
spike rate by finding a linear fit between X_in and R.
It will adjust samples by removing this linear trend, i.e.
interpolating to given rate R.
Original coding: Matt Kennel 2004
Edited: Shlens 2006-02-14
This function calls: