
|
Table des matières
1 Stoping time problem
Let
And the optimal stopping time :
// A stoping time problem. c=... // instantaneous cost K=... // final cost r=0.05; C=ones(N,T); // a matrix to store the value function U=2*ones(N,T); // a matrix to store the control (1 or 2) C(:,T) = ... ; for i=T-1:-1:1 .... C(:,i)= Ci; U(:,i)= ki; end plot3d(1:N,1:T,C)
m=10000; // number of samplings Cm=0; // we want to evaluate C(1,1); for k=1:m // loop on sampling // the k-th trajectory. X=.... // sample a trajectory // the control along the trajectory for i=1:T, u(i)=... end stop=... // the stopping time cost=0; ... cost = .. // evaluate the cost for the m-th trajectory Cm=Cm+cost/m; // compute the mean end
|