annotate rDiff/src/locfit/m/gcv.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
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=gcv(varargin)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
2
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
3 fit = locfit(varargin{:});
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
4 rs = rsum(fit);
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
5
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
6 df0 = rs(1);
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
7 df1 = rs(2);
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
8 llk = rs(3);
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
9 n = size(fit.data.x,1);
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
10 gc = -2*n*llk/((n-df0)^2);
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
11 g = [llk df0 df1 gc];
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
12
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
13 return;