modele_marche_aleatoire

Marche aléatoire.

Espace de nom : tsd::kalman

Prototype

sptr<SSMLineaire> modele_marche_aleatoire(entier ndim=1, const Tabf &Q=Tabf(), const Tabf &R=Tabf())

Paramètres

ndimNombre de dimensions (1 = modèle scalaire)
QCovariance du bruit de process
RCovariance du bruit d'observation

Retourne

Modèle en représentation d'état

Description

This function create a simple scalar or vectorial random walk model, e.g. at each time interval, the state is incremented by a random value, and observed through a noisy measurement. That is: \[ x_n = x_{n-1} + u_n,\quad y_n = x_n+v_n\] avec \(u_n: \mathcal{N}(0,R), v_n: \mathcal{N}(0,Q)\).

Exemple en dimension 2 :


  // Variance du bruit de process
  soit s2_process = 1.0f;
  // Variance du bruit d'observation
  soit s2_obs     = 0.05f;

  soit Q = s2_process * Tabf::eye(2);
  soit R = s2_obs     * Tabf::eye(2);

  soit sys = modele_marche_aleatoire(2, Q, R);

  // 200 itérations
  soit [x,y] = sys->steps(200);

  Figure f;
  f.plot(x.row(0), x.row(1), "b-o", "Vrais états");
  f.plot(y.row(0), y.row(1), "m-o", "Observations");

Voir aussi

ssm_simu(), model_kitagawa(), model_imu(), model_constant()