Skip to main content
deleted 7 characters in body
Source Link
rm -rf
  • 89.3k
  • 21
  • 297
  • 479

A straightforward way would be using recursion and memoization. An example:

n = 5;
c = RandomReal[NormalDistribution[], n]/100;

Clear[x]
Array[(x[#] = RandomReal[NormalDistribution[]]) &, n]; (* Initial conditions *)
x[t_Integer] /; t > n := x[t] = Total[c*Table[x[i]c.Table[x[i], {i, t - 1, t - n, -1}]]] +
     RandomReal[NormalDistribution[]]

ListLinePlot[x /@ Range[300]]

enter image description here

A straightforward way would be using recursion and memoization. An example:

n = 5;
c = RandomReal[NormalDistribution[], n]/100;

Clear[x]
Array[(x[#] = RandomReal[NormalDistribution[]]) &, n]; (* Initial conditions *)
x[t_Integer] /; t > n := x[t] = Total[c*Table[x[i], {i, t - 1, t - n, -1}]] +
     RandomReal[NormalDistribution[]]

ListLinePlot[x /@ Range[300]]

enter image description here

A straightforward way would be using recursion and memoization. An example:

n = 5;
c = RandomReal[NormalDistribution[], n]/100;

Clear[x]
Array[(x[#] = RandomReal[NormalDistribution[]]) &, n]; (* Initial conditions *)
x[t_Integer] /; t > n := x[t] = c.Table[x[i], {i, t - 1, t - n, -1}] +
     RandomReal[NormalDistribution[]]

ListLinePlot[x /@ Range[300]]

enter image description here

added 23 characters in body
Source Link
rm -rf
  • 89.3k
  • 21
  • 297
  • 479

OneA straightforward way would be using recursion and memoization. An example:

n = 5;
c = RandomReal[NormalDistribution[], n];n]/100;

Clear[x]
Array[(x[#] = RandomReal[NormalDistribution[]]) &, n]; (* Initial conditions *)
x[t_Integer] /; t > n := x[t] = Total[c*Table[x[i], {i, t - 1, t - n, -1}]] +
     RandomReal[NormalDistribution[]] 

ListLinePlot[x /@ Range[300]]

enter image description here

One way would be using recursion and memoization. An example:

n = 5;
c = RandomReal[NormalDistribution[], n];

Clear[x]
Array[(x[#] = RandomReal[NormalDistribution[]]) &, n];
x[t_Integer] := x[t] = Total[c*Table[x[i], {i, t - 1, t - n, -1}]] +
     RandomReal[NormalDistribution[]]

A straightforward way would be using recursion and memoization. An example:

n = 5;
c = RandomReal[NormalDistribution[], n]/100;

Clear[x]
Array[(x[#] = RandomReal[NormalDistribution[]]) &, n]; (* Initial conditions *)
x[t_Integer] /; t > n := x[t] = Total[c*Table[x[i], {i, t - 1, t - n, -1}]] +
     RandomReal[NormalDistribution[]] 

ListLinePlot[x /@ Range[300]]

enter image description here

Source Link
rm -rf
  • 89.3k
  • 21
  • 297
  • 479

One way would be using recursion and memoization. An example:

n = 5;
c = RandomReal[NormalDistribution[], n];

Clear[x]
Array[(x[#] = RandomReal[NormalDistribution[]]) &, n];
x[t_Integer] := x[t] = Total[c*Table[x[i], {i, t - 1, t - n, -1}]] +
     RandomReal[NormalDistribution[]]