Robert Israel

6522 Reputation

21 Badges

18 years, 185 days
University of British Columbia
Associate Professor Emeritus
North York, Ontario, Canada

MaplePrimes Activity


These are replies submitted by Robert Israel

The output of PDF looks strange because it involves (unnecessarily) nested piecewise functions.  However, Maple can simplify it:

> simplify(PDF(exp(r*X),t));

              {             0                    t < 0
              {
              {                        2
              {      1/2          ln(t)
              {     2    exp(-1/2 ------)
              {                      2
              {                    r~
              { 1/2 ---------------------        0 <= t
              {            1/2
              {          Pi    t r~

 

Ah, I see: in the "cross sectional" example you are guaranteed a win in the cases where r1 and r2 have different signs, as then r3 must have the same sign as one of them but not the other.  That's where your positive expected value is coming from.  In the "time series" case you're not doing that, you're just using r[i-1] and r[i-2] to guess r[i].  Since r[i] is independent of r[i-1] and r[i-2], knowing r[i-1] and r[i-2] doesn't help you guess r[i].

Ah, I see: in the "cross sectional" example you are guaranteed a win in the cases where r1 and r2 have different signs, as then r3 must have the same sign as one of them but not the other.  That's where your positive expected value is coming from.  In the "time series" case you're not doing that, you're just using r[i-1] and r[i-2] to guess r[i].  Since r[i] is independent of r[i-1] and r[i-2], knowing r[i-1] and r[i-2] doesn't help you guess r[i].

OK then, your expected return is 0.  You correctly calculated probability 1/4 of losing, but neglected to notice that you also have only probability 1/4 of winning, and probability 1/2 of no bet.  

OK then, your expected return is 0.  You correctly calculated probability 1/4 of losing, but neglected to notice that you also have only probability 1/4 of winning, and probability 1/2 of no bet.  

You could get all the solutions in an interval by using both options AllSolutions and explicit:

> solve({cos(2*theta)=1/2,theta>=0,theta<=2*Pi},theta,AllSolutions,explicit);

{theta = 1/6*Pi}, {theta = 7/6*Pi}, {theta = 5/6*Pi}, {theta = 11/6*Pi}

You could get all the solutions in an interval by using both options AllSolutions and explicit:

> solve({cos(2*theta)=1/2,theta>=0,theta<=2*Pi},theta,AllSolutions,explicit);

{theta = 1/6*Pi}, {theta = 7/6*Pi}, {theta = 5/6*Pi}, {theta = 11/6*Pi}

Again, I'm just using the definitions.  X[j] = 1 if j'th coin = H, 0 if T.  Covariance(X[1],X[2]) = E[X[1]*X[2]] - E[X[1]]*E[X[2]].
X[1]*X[2] = 1 for outcomes HHH and HHT (with probabilities a and b), 0 otherwise, so E[X[1]*X[2]] = a+b.
E[X[1]] = E[X[2]] = a + 2*b + c as mentioned previously.
Variance(X[1]) = E[X[1]^2] - E[X[1]]^2.  Since X[1]^2 = X[1], this is E[X[1]] - E[X[1]]^2 = a + 2*b + c - (a + 2*b + c)^2.  Same for X[2].

Again, I'm just using the definitions.  X[j] = 1 if j'th coin = H, 0 if T.  Covariance(X[1],X[2]) = E[X[1]*X[2]] - E[X[1]]*E[X[2]].
X[1]*X[2] = 1 for outcomes HHH and HHT (with probabilities a and b), 0 otherwise, so E[X[1]*X[2]] = a+b.
E[X[1]] = E[X[2]] = a + 2*b + c as mentioned previously.
Variance(X[1]) = E[X[1]^2] - E[X[1]]^2.  Since X[1]^2 = X[1], this is E[X[1]] - E[X[1]]^2 = a + 2*b + c - (a + 2*b + c)^2.  Same for X[2].

1) I'm just using the standard definitions.  CorrelationCoefficient = Covariance(X[1], X[2]) / (StandardDeviation(X[1])*StandardDeviation(X[2])).

2) a = P(HHH), b = P(HHT) = P(HTH), c = P(HTT).  Those are the four outcomes in which the first coin is H.

3) Yes, I solved for a, b and c in terms of p, m and d.  Then add d to the result for a to get a + d, which turns out not to depend on d.

4) m is the probability of heads.  If that is 0, then the result is certainly TTT.

5) Why would you want to do this?  Yes, it seems complicated. 

1) I'm just using the standard definitions.  CorrelationCoefficient = Covariance(X[1], X[2]) / (StandardDeviation(X[1])*StandardDeviation(X[2])).

2) a = P(HHH), b = P(HHT) = P(HTH), c = P(HTT).  Those are the four outcomes in which the first coin is H.

3) Yes, I solved for a, b and c in terms of p, m and d.  Then add d to the result for a to get a + d, which turns out not to depend on d.

4) m is the probability of heads.  If that is 0, then the result is certainly TTT.

5) Why would you want to do this?  Yes, it seems complicated. 

No, you don't have any second derivatives in what you posted, although maybe the equations were a bit garbled (try posting text instead of images).  And did you read my reply from that thread?  If you do have a system with those derivatives, the most important sentence in this case is "As the error message says, it can only handle two independent variables".

No, you don't have any second derivatives in what you posted, although maybe the equations were a bit garbled (try posting text instead of images).  And did you read my reply from that thread?  If you do have a system with those derivatives, the most important sentence in this case is "As the error message says, it can only handle two independent variables".

True.  It would be nice to be able to compare with the solution from dsolve(..., numeric), but unfortunately we don't know the differential equation. 
What you can do is compare the Pade approximants using different degrees, and see where there appears to be convergence.  For example:
 

> for j from 1 to 7 do P[j]:= numapprox[pade](F,x=1,[j+1,j]) end do:
  plot([seq(P[j],j=1..7)],x=0..4, -5..30, colour=[red,orange,yellow,green,blue,violet,black]);

The blue, violet and black curves are very close together for about 0 <= x <= 2.3, but diverge outside that interval.  So I guess we're not much closer to plotting on the interval 0..4. 

True.  It would be nice to be able to compare with the solution from dsolve(..., numeric), but unfortunately we don't know the differential equation. 
What you can do is compare the Pade approximants using different degrees, and see where there appears to be convergence.  For example:
 

> for j from 1 to 7 do P[j]:= numapprox[pade](F,x=1,[j+1,j]) end do:
  plot([seq(P[j],j=1..7)],x=0..4, -5..30, colour=[red,orange,yellow,green,blue,violet,black]);

The blue, violet and black curves are very close together for about 0 <= x <= 2.3, but diverge outside that interval.  So I guess we're not much closer to plotting on the interval 0..4. 

First 31 32 33 34 35 36 37 Last Page 33 of 187