invlink.m 603 B

123456789101112131415161718192021222324
  1. function y0 = invlink(y,fali)
  2. % inverse link function for locfit.
  3. % y is a vector of raw fitted values.
  4. % fali is the integer [family link] vector from locfit.
  5. % output is the inv. link.
  6. link = fali(2);
  7. switch(link)
  8. case 3 % identity
  9. y0 = y;
  10. case 4 % log
  11. y0 = exp(y);
  12. case 5 % logit - should invert carefully!
  13. y0 = 1 - 1./(1+exp(y));
  14. case 6 % inverse
  15. y0 = 1/y;
  16. case 7 % sqrt
  17. y0 = y*abs(y);
  18. case 8 % arcsin
  19. y0 = sin(y)*sin(y);
  20. otherwise
  21. disp('invlink: Unknown link function');
  22. end;