root / trunk / tests / ctl / example.tpl @ 1533
History  View  Annotate  Download (692 Bytes)
1 
DATA_SECTION 

2 
init_int nobs; 
3 
init_vector y(1,nobs); 
4 
init_vector x(1,nobs); 
5  
6 
!! ad_comm::change_datafile_name("example.ctl"); 
7 
init_vector a_lup(1,3); 
8 
init_vector b_lup(1,3); 
9 
init_vector sig_lup(1,3); 
10  
11 
init_matrix theta_lup(1,3,1,3); 
12 
PARAMETER_SECTION 
13  
14 
init_bounded_number a(a_lup); 
15 
init_bounded_number b(b_lup); 
16 
init_bounded_number sig(sig_lup); 
17  
18 
init_bounded_number_vector theta(theta_lup); 
19 
objective_function_value f; 
20  
21 
vector y_hat(1,nobs); 
22 
vector y2_hat(1,nobs); 
23  
24 
INITIALIZATION_SECTION 
25 
sig 1.0; 
26  
27  
28 
PROCEDURE_SECTION 
29 

30 
y_hat = a + b * x; 
31 
y2_hat = theta(1) + theta(2)*x; 
32 
f = dnorm(y  y_hat, sig); 
33 
f += dnorm(yy2_hat,theta(3)); 
34  
35 