Mercurial > repos > vipints > rdiff
annotate rDiff/src/locfit/m/lcv.m @ 3:29a698dc5c7e default tip
Merge multiple heads.
author | Dave Bouvier <dave@bx.psu.edu> |
---|---|
date | Mon, 27 Jan 2014 14:15:36 -0500 |
parents | 0f80a5141704 |
children |
rev | line source |
---|---|
0 | 1 function g=lcv(varargin) |
2 % | |
3 % likelihood cross-validation. | |
4 % | |
5 % returned vector consists of log-likelihood, trace(H), trace(H'H) | |
6 % and cross-validated deviance (-2 * cross-validated log-likelihood). | |
7 % | |
8 % Author: Catherine Loader. | |
9 | |
10 fit = locfit(varargin{:},'ev','cros'); | |
11 rs = rsum(fit); | |
12 | |
13 df0 = rs(1); | |
14 df1 = rs(2); | |
15 llk = rs(3); | |
16 | |
17 g = [llk df0 df1 -2*llk]; | |
18 | |
19 return; |