File: test.cpp

package info (click to toggle)
dynare 4.5.7-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 49,408 kB
  • sloc: cpp: 84,998; ansic: 29,058; pascal: 13,843; sh: 4,833; objc: 4,236; yacc: 3,622; makefile: 2,278; lex: 1,541; python: 236; lisp: 69; xml: 8
file content (32 lines) | stat: -rw-r--r-- 1,007 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "dynareR.cpp"

int main(void) {
	const char *parameters[] = {"beta","gamma","rho","alpha","delta"};
	const char *varendo[] = {"k","c","a"};
	const char *varexo[] = {"eps"};
	const int numpar = 5;
	const int numendo = 3;
	const int numexo = 1;
	const int ord = 2;
	const int numsteps = 0;
	const double parval[] = {.99,2,.9,.3,.025};
	const double vcov[] = {0.001};
	const double initval[] = {0.066, 0.43, 0.01};

	int e;
	double tensorbuffer[100];
	int num_state;
	int ordering_state[] = {0,0,0};
	int ordering_endo[] = {0,0,0};
	int ordering_exo[] = {0};
	double newinitval[] = {0,0,0};
	
	const char *modeleq[] = {"(c/c(1))^gamma*beta*(alpha*exp(a(1))*k^(alpha-1)+1-delta)=1; a=rho*a(-1)+eps; k+c=exp(a)*k(-1)^alpha+(1-delta)*k(-1);"};

	dynareR(varendo, &numendo, varexo, &numexo, parameters, &numpar, modeleq,
			&ord, "journal", parval, vcov, initval,
			&numsteps, tensorbuffer,
			&num_state, ordering_state, ordering_endo, ordering_exo,
			newinitval,&e);
	printf("error code: %d\n", e);
}