generate_observed_ARp
PURPOSE
% generate_observed_ARp: generates samples of autoregressive processes
SYNOPSIS
function [x,y,sigma_x,sigma_y] = generate_observed_ARp(N,p,q,sigma_e,sigma_n)
DESCRIPTION
CROSS-REFERENCE INFORMATION
This function calls:
This function is called by:
SOURCE CODE
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 function [x,y,sigma_x,sigma_y] = generate_observed_ARp(N,p,q,sigma_e,sigma_n)
0021
0022
0023 x = zeros(N,1);
0024 y = zeros(N,1);
0025
0026
0027 c = poly(q*ones(1,p));
0028 a = -c(2:p+1)';
0029
0030
0031 sigma_x = sigma_e/sqrt((1-q)^p);
0032 sigma_y = sqrt(sigma_x^2+sigma_n^2);
0033
0034
0035 for n=p+1:N
0036 x(n) = sum(a(1:p).*x(n-1:-1:n-p))+randn(1)*sigma_e;
0037 y(n) = x(n)+randn(1)*sigma_n;
0038 end
0039
0040
Generated on Sat 21-Jul-2018 20:56:10 by m2html © 2005