PatrickT

Dr. Patrick T

2168 Reputation

18 Badges

17 years, 175 days

MaplePrimes Activity


These are replies submitted by PatrickT

I'll answer my own question -- but allow me to ask: is this the most efficient way to construct the matrix below?



hdr := < < `x`          | `f(x)` >,
         < `----------` | `----------` > >:
X := [1, 2, 3, 4, 5]:
body := < seq( < x | f(x) >, x = X ) >:
< hdr, body >;

                      [    x            f(x)   ]
                      [                        ]
                      [----------    ----------]
                      [                        ]
                      [    1            f(1)   ]
                      [                        ]
                      [    2            f(2)   ]
                      [                        ]
                      [    3            f(3)   ]
                      [                        ]
                      [    4            f(4)   ]
                      [                        ]
                      [    5            f(5)   ]

I'll answer my own question -- but allow me to ask: is this the most efficient way to construct the matrix below?



hdr := < < `x`          | `f(x)` >,
         < `----------` | `----------` > >:
X := [1, 2, 3, 4, 5]:
body := < seq( < x | f(x) >, x = X ) >:
< hdr, body >;

                      [    x            f(x)   ]
                      [                        ]
                      [----------    ----------]
                      [                        ]
                      [    1            f(1)   ]
                      [                        ]
                      [    2            f(2)   ]
                      [                        ]
                      [    3            f(3)   ]
                      [                        ]
                      [    4            f(4)   ]
                      [                        ]
                      [    5            f(5)   ]

Many thanks Joe, for your very timely help!

Many thanks Joe, for your very timely help!

Thanks Joe, that's pretty close.

In the following, how do I tell f to evaluate at the values given in the X and Y lists, so as to get the output shown ?

 

X := [25, 30, 35];
Y := [25, 30, 35];
Matrix(3,3,f????);



                                        [f(25, 25)    f(25, 30)    f(25, 35)]
                                        [                             ]
                                        [f(30, 25)    f(30, 30)    f(30, 35)]
                                        [                             ]
                                        [f(35, 25)    f(35, 30)    f(35, 35)]



Thanks Joe, that's pretty close.

In the following, how do I tell f to evaluate at the values given in the X and Y lists, so as to get the output shown ?

 

X := [25, 30, 35];
Y := [25, 30, 35];
Matrix(3,3,f????);



                                        [f(25, 25)    f(25, 30)    f(25, 35)]
                                        [                             ]
                                        [f(30, 25)    f(30, 30)    f(30, 35)]
                                        [                             ]
                                        [f(35, 25)    f(35, 30)    f(35, 35)]



Actually, I've got a function of 2 variables to arrange in a matrix, so perhaps I need something a little different -- instead of hijacking this thread further, I started a new thread: http://www.mapleprimes.com/forum/matrixcontainingvaluesfxylistxy

Actually, I've got a function of 2 variables to arrange in a matrix, so perhaps I need something a little different -- instead of hijacking this thread further, I started a new thread: http://www.mapleprimes.com/forum/matrixcontainingvaluesfxylistxy

Doug: I just reached this old thread, which seems to be doing something I'm after.

Would you give an example of what to write on the right-hand side of:

body :=
body2 :=

many thanks,

Patrick.

Doug: I just reached this old thread, which seems to be doing something I'm after.

Would you give an example of what to write on the right-hand side of:

body :=
body2 :=

many thanks,

Patrick.

Thanks for getting back with what you did. It was incredibly slow on my machine, I had to set h:=0.01: to obtain something in finite time. Nice.

P.S. proper credit belongs to Robert, as I merely copied his input.

Thanks for getting back with what you did. It was incredibly slow on my machine, I had to set h:=0.01: to obtain something in finite time. Nice.

P.S. proper credit belongs to Robert, as I merely copied his input.

There's a substitution that will solve this ODE. I don't know enough Maple to help much here.

The substition below supposedly simplifies the equation, but its solution is not yet expressible in a simple way...

ODE := diff(y(t),t,t) + t*diff(y(t),t) + 4*y(t) = 0;
odeadvisor(ODE);
[[_2nd_order, _with_linear_symmetries]]
PDEtools[dchange]({y(t)=exp(u(t))},ODE,[u(t)]);
newODE := simplify(%/exp(u(t)));
odeadvisor(newODE);
[[_2nd_order, _missing_y], [_2nd_order, _reducible, _mu_xy]]
dsolve(newODE);

There's a substitution that will solve this ODE. I don't know enough Maple to help much here.

The substition below supposedly simplifies the equation, but its solution is not yet expressible in a simple way...

ODE := diff(y(t),t,t) + t*diff(y(t),t) + 4*y(t) = 0;
odeadvisor(ODE);
[[_2nd_order, _with_linear_symmetries]]
PDEtools[dchange]({y(t)=exp(u(t))},ODE,[u(t)]);
newODE := simplify(%/exp(u(t)));
odeadvisor(newODE);
[[_2nd_order, _missing_y], [_2nd_order, _reducible, _mu_xy]]
dsolve(newODE);

you do need to make assumptions about the stochastic process in order to derive explicit calculations of the variances and covariances -- why don't you assume that the xs are fixed real numbers? then your life would be a great deal easier as you would only need to track the effects of the error term (but hey you will need to make an assumption about the error term sooner rather than later).

If you want your xs to be stochastic, you could perhaps assume they are drawn from a normal distribution (this is a popular choice of stochastic process) and independent of the error term (this is a usually very harmful assumption, but unfortunately very common, oh well). You will find the calculations and formulae in any intermediate econometrics books (and in some introductory books too). Once you understand the ideas, you can code it into Maple.

You will find some theory and practical examples in : Introductory Econometrics: A Modern Approach (with Economic Applications, Data Sets, Student Solutions Manual Printed Access Card) by Jeffrey Wooldridge. There are of course many other useful books on the subject. I bet there are "econometrics with Maple" books too, though I have never read one.

A popular software for econometrics is Stata, which has all these formulae already coded in, and like Maple has a vibrant online commmunity, but by all means do try to code the formulae yourself in Maple, you won't unlearn from that.

First 75 76 77 78 79 80 81 Last Page 77 of 93