Melody Ghahramani
2010-Mar-04 20:45 UTC
[R] partial differentiation of a dynamic expression
Hello, It is possible to use 'deriv' when the expression itself is dynamic? I have data where the conditional mean is time-varying (like a GARCH(1,1) model) as mu_{t} = omega1 + alpha1*N_{t-1} + beta1*mu_{t-1}. The parameter vector is c("omega1", "alpha1", "beta1") and N_t is the observation at each time. I want two things: 1. the derivative of mu_t with respect to each parameter. So for example, the first derivative with respect to omega1 is "1 + beta1* d mu_{t-1}/ d omega1." 2. Once I have the expression in 1, I want its first partial derivative. Ultimately, I want to find the root of an estimating function using Newton-Raphson, where param <- param - solve(mat)%*% param, and where param is an estimating function which has first partial derivatives in it and 'mat' is a matrix which involves the first partial derivatives of elements in 'param'. Thanks, Melody [[alternative HTML version deleted]]