annotate rDiff/src/locfit/m/lcv.m @ 2:233c30f91d66

updated python based GFF parsing module which will handle GTF/GFF/GFF3 file types
author vipints <vipin@cbio.mskcc.org>
date Tue, 08 Oct 2013 07:15:44 -0400
parents 0f80a5141704
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
1 function g=lcv(varargin)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
2 %
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
3 % likelihood cross-validation.
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
4 %
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
5 % returned vector consists of log-likelihood, trace(H), trace(H'H)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
6 % and cross-validated deviance (-2 * cross-validated log-likelihood).
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
7 %
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
8 % Author: Catherine Loader.
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
9
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
10 fit = locfit(varargin{:},'ev','cros');
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
11 rs = rsum(fit);
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
12
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
13 df0 = rs(1);
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
14 df1 = rs(2);
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
15 llk = rs(3);
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
16
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
17 g = [llk df0 df1 -2*llk];
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
18
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
19 return;