backtr.m 502 B

123456789101112131415161718192021222324252627282930313233
  1. function z=backtr(y,fit)
  2. %
  3. % Inverse-link transformation of y.
  4. fali = fit.fit_points.family_link;
  5. link = fali(2);
  6. switch link
  7. case 3
  8. z=y;
  9. case 4
  10. z=exp(y);
  11. case 5
  12. z = y;
  13. i = find(y<=0);
  14. if (length(i)>0)
  15. z(i) = exp(y(i))./(1+exp(y(i)));
  16. end;
  17. i = find(y>0);
  18. if (length(i)>0)
  19. z(i) = 1./(1+exp(-y(i)));
  20. end;
  21. case 6
  22. z=1./y;
  23. case 7
  24. z=y.*abs(y);
  25. case 8
  26. z=sin(y).^2;
  27. otherwise
  28. disp('Backtr: invalid link');
  29. z=y;
  30. end;
  31. return;