Last change
on this file since 217 was
217,
checked in by Peter, 18 years ago
|
test_regression_local added
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
File size:
682 bytes
|
Line | |
---|
1 | // $Id: test_regression_local.cc 217 2004-12-29 09:37:24Z peter $ |
---|
2 | |
---|
3 | // C++ tools include |
---|
4 | //////////////////// |
---|
5 | #include "RegressionKernelBox.h" |
---|
6 | #include "RegressionLinear.h" |
---|
7 | #include "RegressionLocal.h" |
---|
8 | #include "vector.h" |
---|
9 | |
---|
10 | |
---|
11 | // Standard includes |
---|
12 | //////////////////// |
---|
13 | #include <iostream> |
---|
14 | #include <cmath> |
---|
15 | |
---|
16 | using namespace theplu; |
---|
17 | |
---|
18 | int main() |
---|
19 | |
---|
20 | { |
---|
21 | bool ok=true; |
---|
22 | |
---|
23 | gslapi::vector x(1000); |
---|
24 | gslapi::vector y(1000); |
---|
25 | for (size_t i=0; i<1000; i++){ |
---|
26 | x(i)=static_cast<double>(i)/100; |
---|
27 | y(i)=sin(x(i)); |
---|
28 | } |
---|
29 | |
---|
30 | gslapi::vector x_est(11); |
---|
31 | for (size_t i=0; i<11; i++) |
---|
32 | x_est(i)=i; |
---|
33 | |
---|
34 | statistics::RegressionLinear r; |
---|
35 | statistics::RegressionKernelBox k; |
---|
36 | statistics::RegressionLocal rl(x,y,r,k,x_est); |
---|
37 | rl.fit(0.1); |
---|
38 | |
---|
39 | if (ok) |
---|
40 | return 0; |
---|
41 | return -1; |
---|
42 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.