Mercurial > repos > vipints > rdiff
comparison rDiff/src/locfit/m/invlink.m @ 0:0f80a5141704
version 0.3 uploaded
author | vipints |
---|---|
date | Thu, 14 Feb 2013 23:38:36 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:0f80a5141704 |
---|---|
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 | |
7 link = fali(2); | |
8 | |
9 switch(link) | |
10 case 3 % identity | |
11 y0 = y; | |
12 case 4 % log | |
13 y0 = exp(y); | |
14 case 5 % logit - should invert carefully! | |
15 y0 = 1 - 1./(1+exp(y)); | |
16 case 6 % inverse | |
17 y0 = 1/y; | |
18 case 7 % sqrt | |
19 y0 = y*abs(y); | |
20 case 8 % arcsin | |
21 y0 = sin(y)*sin(y); | |
22 otherwise | |
23 disp('invlink: Unknown link function'); | |
24 end; |