--Cheikh
You received this message because you are subscribed to the Google Groups "pystatsmodels" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pystatsmodel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pystatsmodels/63534c88-104f-4e05-a1aa-ae35539c1b7b%40googlegroups.com.
On Sat, Nov 16, 2019 at 1:27 PM Cheikh Ibrahima Nokho <cheikhibra...@gmail.com> wrote:Hi All,I was trying to implement a Consumption-based CAPM using the GMM.NonlinearIVGMM function of Statsmodel.I have several moment conditions (one moment for each asset).Is there anyway to include for example 5 moment conditions (equations)?There is only one argument (func) in the fonction GMM.NonlinearIVGMM.The moment conditions are in columns, so they should be a 2-D array when evaluated at the parameters.If the instruments are not common to all moment conditions, then IV doesn't work directly and instruments need to be incorporated in each column.(IIRC, I have an example where the instrument is just a vector of ones, and the nonlinear moment conditions in the columns include the instruments)Do you have the equations for the moment conditions?We have some simple CAPM with GMM examples, but I haven't looked at this in a long time.
To view this discussion on the web visit https://groups.google.com/d/msgid/pystatsmodels/CAMMTP%2BDt4n9gCV5Z-FZiTdwdVQa4cwWOv%3D%3DvfvXKTESCuqMnUQ%40mail.gmail.com.
Thanks for your reply.
It is a CCAPM with a power utility function (find attached the equation where i denotes a country).For my case, I have 5 countries (the G5 countries).Does it mean that I need to create a function representing the moment condition with a 5 columns matrix as output?
To view this discussion on the web visit https://groups.google.com/d/msgid/pystatsmodels/0a65be06-f489-4271-b53a-4e0ab857a14e%40Spark.
On Sat, Nov 16, 2019 at 2:05 PM Cheikh Ibrahima Nokho <cheikhibra...@gmail.com> wrote:Thanks for your reply.
It is a CCAPM with a power utility function (find attached the equation where i denotes a country).For my case, I have 5 countries (the G5 countries).Does it mean that I need to create a function representing the moment condition with a 5 columns matrix as output?5 times the number of parameters if parameters are country specificIn the actual computation we need at least as many moment conditions as parameters.Each moment condition is a column, and the weight and covariance matrices are computed for these columns.
On Sat, Nov 16, 2019 at 2:05 PM Cheikh Ibrahima Nokho <cheikhibr...@gmail.com> wrote:Thanks for your reply.
It is a CCAPM with a power utility function (find attached the equation where i denotes a country).For my case, I have 5 countries (the G5 countries).Does it mean that I need to create a function representing the moment condition with a 5 columns matrix as output?5 times the number of parameters if parameters are country specificIn the actual computation we need at least as many moment conditions as parameters.Each moment condition is a column, and the weight and covariance matrices are computed for these columns.I never tried this:If moments are only correlated within a country but not between countries, then I think the appropriate structure would be a block diagonal moment matrix with each country forming a block in different rows.
special case IVZ * (y - f(x, params))or if y is set to zero and f is negated, then `Z * f(x, params)`AFAIR, in this case `(y - f(x, params))` has to be scalar like the residual for the univariate case (a single column)Then, the number of moment conditions are coming from the number of instruments, columns of Z.AFAIR, it is not possible that both Z and (y - f(x, params)) have more than one column (breaks numpy broadcasting and would need a definition different from standard linalg).If Z=ones, y=zeros, then we are essentially back to generic nonlinear GMM where f(y, x, params) fully specifies moment conditions.Josef
Cheikh
On Sat, Nov 16, 2019 at 1:27 PM Cheikh Ibrahima Nokho <cheikhibr...@gmail.com> wrote:Hi All,I was trying to implement a Consumption-based CAPM using the GMM.NonlinearIVGMM function of Statsmodel.I have several moment conditions (one moment for each asset).Is there anyway to include for example 5 moment conditions (equations)?There is only one argument (func) in the fonction GMM.NonlinearIVGMM.The moment conditions are in columns, so they should be a 2-D array when evaluated at the parameters.If the instruments are not common to all moment conditions, then IV doesn't work directly and instruments need to be incorporated in each column.(IIRC, I have an example where the instrument is just a vector of ones, and the nonlinear moment conditions in the columns include the instruments)Do you have the equations for the moment conditions?We have some simple CAPM with GMM examples, but I haven't looked at this in a long time.Josef
--Cheikh
You received this message because you are subscribed to the Google Groups "pystatsmodels" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pystat...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pystatsmodels/63534c88-104f-4e05-a1aa-ae35539c1b7b%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "pystatsmodels" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pystat...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pystatsmodels/CAMMTP%2BDt4n9gCV5Z-FZiTdwdVQa4cwWOv%3D%3DvfvXKTESCuqMnUQ%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "pystatsmodels" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pystat...@googlegroups.com.