For the following formula I get the error message G0520 : Arguments not conformable
Can anyone help me what I did wrong?
y = 100*(trimr(d,1,0) - trimr(d,0,1)) ~ 100*(trimr(d,2,0) - trimr(d,1,0)) ~ trimr(s - x*theta_pv,1,0);
Before the formula was just
y = 100*(trimr(d,1,0) - trimr(d,0,1)) ~ trimr(s - x*theta_pv,1,0);
but I wanted to increase the number of lags to two. However now for the modified version I get this error message.
I would be very grateful for your support.
1 Answer
0
This error is occurring, because the terms:
(trimr(d,1,0) - trimr(d,0,1));
and
(trimr(d,2,0) - trimr(d,1,0));
have different numbers of rows. As a specific illustration, if:
d = { -0.3,
0.65,
-0.21,
0.89,
-1.25 };
then:
(trimr(d,1,0) - trimr(d,0,1)) =
0.650 - -0.300 = 0.950
-0.210 - 0.650 = -0.860
0.890 - -0.210 = 1.100
-1.250 - 0.890 = -2.140
However,
(trimr(d,2,0) - trimr(d,1,0)) =
- -0.300 = error, rows do not match (arguments not conformable)
-0.210 - 0.650 = -0.860
0.890 - -0.210 = 1.100
-1.250 - 0.890 = -2.140
I am not certain what you are trying to do, but if you wanted the first and second lag of the first difference, you could to this:
first_diff = (trimr(d,1,0) - trimr(d,0,1));
fd_lag12 = lagn(first_diff, 1| 2);
or simply
y = lagn(trimr(d,1,0) - trimr(d,0,1), 1 | 2);
Your Answer
1 Answer
This error is occurring, because the terms:
(trimr(d,1,0) - trimr(d,0,1));
and
(trimr(d,2,0) - trimr(d,1,0));
have different numbers of rows. As a specific illustration, if:
d = { -0.3,
0.65,
-0.21,
0.89,
-1.25 };
then:
(trimr(d,1,0) - trimr(d,0,1)) =
0.650 - -0.300 = 0.950
-0.210 - 0.650 = -0.860
0.890 - -0.210 = 1.100
-1.250 - 0.890 = -2.140
However,
(trimr(d,2,0) - trimr(d,1,0)) =
- -0.300 = error, rows do not match (arguments not conformable)
-0.210 - 0.650 = -0.860
0.890 - -0.210 = 1.100
-1.250 - 0.890 = -2.140
I am not certain what you are trying to do, but if you wanted the first and second lag of the first difference, you could to this:
first_diff = (trimr(d,1,0) - trimr(d,0,1));
fd_lag12 = lagn(first_diff, 1| 2);
or simply
y = lagn(trimr(d,1,0) - trimr(d,0,1), 1 | 2);