nickellfunc.m (572B)
1 % nickellfunc.m value=nickellfunc(rho); 2 % The Nickell Bias function f(rho)=0 expressed 3 % so as to allow FZERO to solve for rho when given rhohat and Tr 4 % (rhohat and Tr will be global to avoid naming them in the function). 5 % 6 % Formula in Nickell (1981) as rhohat-rho = g(rho). 7 % We write this as f(rho)=g(rho) - (rhohat-rho) and find a zero. 8 9 function value=nickellfunc(rho); 10 11 global rhohat Tr; 12 approx= -(1+rho)/(Tr-1); 13 num = approx*(1-1/Tr*(1-rho^Tr)/(1-rho)); 14 den = 1-2*rho/(1-rho)/(Tr-1)*(1-1/Tr*(1-rho^Tr)/(1-rho)); 15 grho = num/den; 16 value = grho - (rhohat-rho);