00:01
In this question we have to make the r function genr that simulates an autoregression model with gaussian white noise.
00:09
So here are the code for this question in r language.
00:14
First we have to make a simulate an autoregressive model.
00:19
So for this the code will be written as genar function and noise where coefficients initial value p length coefficient, ips norm, r norm, n mean is equal to 0, sg is equal to, surt noise where.
00:48
Then ts data is numeric n.
00:53
Now we are choosing for loop.
00:55
So for t in 1 is to n, ts data t if t less than equal to p, sum of coefficient 1 is to t, multiplied by rev initial values p plus t, p minus t plus 1 is to p plus ips t.
01:46
Ils sum coefficient multiplied by ts data t minus p is to t minus 1 plus ips t.
02:11
Then ts, ts data.
02:13
After that we have to simulate the given model...