function Yhat = freundlich(params,X);

% p.161
% a min or a max at X = exp(1/gamma);
% if alfa or beta are negative, a minimum is obtained

alfa =params(1);
beta =params(2);
gamma=params(3);

% substitute with the expected value parameter y1, correspnding to
% X=X1, so that 
Yhat1 = alfa * (X(1)^(beta*(X(1)^(-gamma))));
alfa = Yhat1 / (X(1)^(beta*(X(1)^(-gamma))));

% Model itself
Yhat  = alfa * (X  .^(beta*(X  .^(-gamma))));


% x=repmat((1:15)',36,1);
% Y=reshape(roi(roi_idx).Yraw_tr_dtr_bp_bin{c}',540,1)
% p=[6 16 1 1 6 0]
% nlinfit(x,Y,'nlin_hrf',p)
