How do I enter a list into Maple TA

I want to write some stats questions on forecasting. I would like to have a list which is a time series, and use Moving Average to derive forecasts, then calculate my errors, etc. I can do it all in Maple, but I don't know how to create a list in Maple TA. For instance, how do I create A in Maple TA's algorithm, where A is defined by:

A:= [seq(round(RandomTools[Generate](distribution(Normal(40,5)),1)), i=1..20)];

This is just a  list of some "sales figures" distributed approximately normally.

Thanks in advance

Stephen

 

MapleTA list

I think you want

$A=maple("[seq(round(RandomTools[Generate](distribution(Normal(40,5)),1)), i=1..20)]");

 

Manipulating lists

Thanks, that is straightforward. I want to using a moving average to forward. I'm going back in time, to make the indexing easier, so the next thing I want to do is average pairs of values. In Maple, I go:

B:=[seq((A[i+1]+A[i+2])/2, i=1..18)]; and I get

[75/2, 77/2, 71/2, 34, 36, 77/2, 87/2, 83/2, 40, 41, 38, 73/2, 81/2, 40, 69/2, 33, 85/2, 99/2]

In Maple TA I get:

[1/2*A[2]+1/2*A[3], 1/2*A[3]+1/2*A[4], 1/2*A[4]+1/2*A[5], 1/2*A[5]+1/2*A[6], 1/2*A[6]+1/2*A[7], 1/2*A[7]+1/2*A[8], 1/2*A[8]+1/2*A[9], 1/2*A[9]+1/2*A[10], 1/2*A[10]+1/2*A[11], 1/2*A[11]+1/2*A[12], 1/2*A[12]+1/2*A[13], 1/2*A[13]+1/2*A[14], 1/2*A[14]+1/2*A[15], 1/2*A[15]+1/2*A[16], 1/2*A[16]+1/2*A[17], 1/2*A[17]+1/2*A[18], 1/2*A[18]+1/2*A[19], 1/2*A[19]+1/2*A[20]]

 

Thanks,

Stephen

MapleTA variables

So you want

 

$A=maple("[seq(round(RandomTools[Generate](distribution(Normal(40,5)),1)), i=1..20)]");

$B=maple("[seq(($A[i+1]+$A[i+2])/2, i=1..18)]");

Notice how MapleTA variables have a dollar sign at the beginning of their name.

  I bet you get it now!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
}