3
$\begingroup$

I want to create a list of numbers that would come form a process in which each number depends on the past value and a white noise. But I'd like the white noise to be non-stationary in the mean; the mean should go up with every period.

Here's what I came up with, but it's only with a stationary white noise:

SeedRandom["série5"]
série5 = 
  Flatten @ 
    NestList[
      0.5*# + RandomVariate[NormalDistribution[2, 1], 1]&, RandomReal[], 10]

Any ideas?

$\endgroup$
2
  • $\begingroup$ Can't FractionalBrownianMotionProcess and FractionalGaussianNoiseProcess be employed? $\endgroup$
    – corey979
    Commented Sep 5, 2016 at 17:57
  • $\begingroup$ @Karsten7. thanks $\endgroup$
    – E Bassal
    Commented Sep 5, 2016 at 18:40

1 Answer 1

2
$\begingroup$

Different approaches using functional iteration, all resulting in the same output.

SeedRandom["série5"];
série5 = Block[{m = 2 - 0.1}, 
  NestList[0.5*# + RandomVariate[NormalDistribution[m += 0.1, 1]] &, RandomReal[], 10]]

SeedRandom["série5"];
série5 = 
 NestList[{0.5*#[[1]] + RandomVariate[NormalDistribution[#[[2]], 1]], #[[2]] + 0.1} &, 
  {RandomReal[], 2}, 10][[All, 1]]

SeedRandom["série5"];
série5 =
 FoldList[0.5*#1 + RandomVariate[NormalDistribution[#2, 1]] &, RandomReal[], 
  Range[2, 2.9, 0.1]]

SeedRandom["série5"];
série5 =
 FoldList[0.5*#1 + #2 &, RandomReal[],
  Array[RandomVariate[NormalDistribution[#, 1]] &, 10, {2, 2.9}]]

SeedRandom["série5"];
série5 =
 SequenceFoldList[0.5*#1 + #2 &, {RandomReal[]},
  Array[RandomVariate[NormalDistribution[#, 1]] &, 10, {2, 2.9}]]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.