History of AFNI updates  

|
Bob Cox
April 04, 2009 11:19AM
The most general function for linear regression, fitting 1 vector to a sum of 1 or more other vectors, in AFNI is THD_fitter() in file thd_fitter.c. For fitting a single vector (below, avec) to another single vector (bvec), the call would be something like so

int npt ; /* length of vectors */
float *avec , *bvec ; /* vectors of length npt */
floatvec *beta ; /* output from THD_fitter */
float bval ; /* the coefficient you want */
....
beta = THD_fitter( npt , avec , 1 , bvec , 2 , NULL ) ;
bval = beta->ar[0] ; /* your goal */
KILL_floatavec(beta) ; /* toss the trash */

The advantage of this function is that it's easy to add more components to bvec, and get more beta values. This function also allows for sign constraints on the beta values, and for L1 fitting as well as L2 fitting. This function is the core of the program 3dTfitter.

Subject Author Posted

coeff's with THD_pearson_corr()?

Prantik Kundu April 04, 2009 10:11AM

Re: coeff's with THD_pearson_corr()?

Bob Cox April 04, 2009 11:19AM

Re: coeff's with THD_pearson_corr()?

Prantik Kundu April 05, 2009 11:30PM

Re: coeff's with THD_pearson_corr()?

Prantik April 07, 2009 04:03PM

Re: coeff's with THD_pearson_corr()?

Bob Cox April 07, 2009 05:06PM

Re: coeff's with THD_pearson_corr()?

Prantik April 07, 2009 06:37PM

Re: coeff's with THD_pearson_corr()?

bob cox April 07, 2009 07:48PM

Re: coeff's with THD_pearson_corr()?

Bob Cox April 06, 2009 11:30AM

Re: coeff's with THD_pearson_corr()?

Prantik April 06, 2009 11:51AM