parent
351da3b865
commit
23e37e45c4
|
@ -247,8 +247,8 @@ fclose(fid);
|
||||||
% Third print a routine for evaluating VAR_EXPECTATION/PAC_EXPECTATION term (returns a dseries object).
|
% Third print a routine for evaluating VAR_EXPECTATION/PAC_EXPECTATION term (returns a dseries object).
|
||||||
%
|
%
|
||||||
kind = strrep(expectationmodelkind, '-', '_');
|
kind = strrep(expectationmodelkind, '-', '_');
|
||||||
mkdir(sprintf('+%s/+%s', M_.fname, kind));
|
mkdir(sprintf('+%s/+%s/+%s', M_.fname, kind, expectationmodelname));
|
||||||
filename = sprintf('+%s/+%s/evaluate_%s.m', M_.fname, kind, expectationmodelname);
|
filename = sprintf('+%s/+%s/+%s/evaluate.m', M_.fname, kind, expectationmodelname);
|
||||||
fid = fopen(filename, 'w');
|
fid = fopen(filename, 'w');
|
||||||
fprintf(fid, 'function ds = evaluate_%s(dbase)\n\n', expectationmodelname);
|
fprintf(fid, 'function ds = evaluate_%s(dbase)\n\n', expectationmodelname);
|
||||||
fprintf(fid, '%% Evaluates %s term (%s).\n', kind, expectationmodelname);
|
fprintf(fid, '%% Evaluates %s term (%s).\n', kind, expectationmodelname);
|
||||||
|
|
|
@ -60,7 +60,7 @@ verbatim;
|
||||||
ts = simul_backward_model(initialconditions, 15);
|
ts = simul_backward_model(initialconditions, 15);
|
||||||
foo = ts.foo.data;
|
foo = ts.foo.data;
|
||||||
% Evaluate the (VAR) expectation term
|
% Evaluate the (VAR) expectation term
|
||||||
ts{'toto'} = example.var_expectations.evaluate_varexp(ts);
|
ts{'toto'} = example.var_expectations.varexp.evaluate(ts);
|
||||||
% Check tthat the evaluation is correct.
|
% Check tthat the evaluation is correct.
|
||||||
range = dates('2000Q4'):dates('2004Q2');
|
range = dates('2000Q4'):dates('2004Q2');
|
||||||
if max(abs(ts(range).foo.data-ts(range).toto.data))>1e-5
|
if max(abs(ts(range).foo.data-ts(range).toto.data))>1e-5
|
||||||
|
|
Loading…
Reference in New Issue