sreid

56 Reputation

2 Badges

19 years, 320 days

MaplePrimes Activity


These are replies submitted by sreid

The X and Y vectors each have 8 values. The 9th y is for use in a question. I haven't reproduced the entire question. Once I got the error I eliminated lines to find the minimum statements which generated the error.

The X and Y vectors each have 8 values. The 9th y is for use in a question. I haven't reproduced the entire question. Once I got the error I eliminated lines to find the minimum statements which generated the error.

I was hopeful, but adding the package name, as below, still didn't help, I got the same java error.

 

Thanks

$x1=180;
$x2=320;
$x3=200;
$x4=400;
$x5=350;
$x6=220;
$x7=450;
$x8=300;
$SR=maple("
X := Vector([$x1,$x2,$x3,$x4,$x5,$x6,$x7,$x8],datatype =float):
Rsdl := Statistics[RandomVariable](Normal(2000.0, 1000.0));
Resid := Statistics[Sample](Rsdl, 8);
Y := Vector([1, 1, 1, 1, 1, 1, 1, 1, 1], datatype = float);
for i to 8 do Y[i] := evalf[3](40*X[i]+Resid[i]) end do;
solution := Statistics[Fit](b0+b1*x, X, Y, x, output = leastsquaresfunction);
");

I was hopeful, but adding the package name, as below, still didn't help, I got the same java error.

 

Thanks

$x1=180;
$x2=320;
$x3=200;
$x4=400;
$x5=350;
$x6=220;
$x7=450;
$x8=300;
$SR=maple("
X := Vector([$x1,$x2,$x3,$x4,$x5,$x6,$x7,$x8],datatype =float):
Rsdl := Statistics[RandomVariable](Normal(2000.0, 1000.0));
Resid := Statistics[Sample](Rsdl, 8);
Y := Vector([1, 1, 1, 1, 1, 1, 1, 1, 1], datatype = float);
for i to 8 do Y[i] := evalf[3](40*X[i]+Resid[i]) end do;
solution := Statistics[Fit](b0+b1*x, X, Y, x, output = leastsquaresfunction);
");

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

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

I've found solve to be buggy. This is not so bad, but if you try them both with fsolve, they have identical results.

Cheers,

Stephen

I've found solve to be buggy. This is not so bad, but if you try them both with fsolve, they have identical results.

Cheers,

Stephen

fsolve does work. Thanks a lot; I reported the bug. I removed older versions of Maple and never thought to try them.

Thanks, I did spend a lot of time on it, so I was frustrated at it not working. It's a relief to be able to put it away.

Stephen

fsolve does work. Thanks a lot; I reported the bug. I removed older versions of Maple and never thought to try them.

Thanks, I did spend a lot of time on it, so I was frustrated at it not working. It's a relief to be able to put it away.

Stephen

Whatever it is I don't understand, it is in Maple, since that gives the two answers. I'm inverting this function, so the answer should be unique:

The qu file is Download 7361_estimation.zip
View file details
.

Thanks for the help

Stephen

Whatever it is I don't understand, it is in Maple, since that gives the two answers. I'm inverting this function, so the answer should be unique:

The qu file is Download 7361_estimation.zip
View file details
.

Thanks for the help

Stephen

That works very well, with the f's being printed with commas.

Just to make sure I understand it:

The map function applies the rounding to all the members of the array. The e and f variables are just to change the variable type. The e seems to be exactly an integer, but displays with no comma, so it is still floating point. The f is an integer, and displays with a comma. Perfect.

Why the repeated semicolons and the quote and bracket on a separate line?

Thanks for the help

Stephen

That works very well, with the f's being printed with commas.

Just to make sure I understand it:

The map function applies the rounding to all the members of the array. The e and f variables are just to change the variable type. The e seems to be exactly an integer, but displays with no comma, so it is still floating point. The f is an integer, and displays with a comma. Perfect.

Why the repeated semicolons and the quote and bracket on a separate line?

Thanks for the help

Stephen

Page 1 of 1