clear all;
close all;

% problem parameters 

N = 500;          % number of time steps
NP = 10;         % number of particles
sigma_0 = 3.0;    % mean-reverting value in stocastic volatility
mu = 0.006;       % value of drift
c = 0.5;          % r^2/(2*lambda)
                  %  where, r = vol of stochastic volatility
                  %         lambda = rate of mean-reversion
lambda = 2;       % the rate of mean-reversion 
del_t = 0.004;    % time step
T = (1:N)'*del_t; % Time

% preallocation

sigma = zeros(N,1);             % actual volatility
X = zeros(N,1);                 % observed parameter is S(t+del_t)/S(t)

% initialization

sigma(1) = 0.1;                 % initial volatility

% ideal observation (for final comparison)

for t = 2:N
    sigma(t) = g(sigma(t-1),sigma_0,lambda,c,del_t);
    X(t) = f(sigma(t),mu,del_t);
end

save N.mat N
save sigma.mat sigma
save X.mat X
save del_t.mat del_t
