0

I am trying to find the spectral density of an MA(2) model using R. This is the formula I came up with but R is telling me there is an "attempt to apply non-function" error. Can't find where I went wrong. Help.

specdensity=
(sigma^2 + ((theta1^2)*(sigma^2))+
((theta2^2)*(sigma^2))+
2(theta1*(sigma^2)+(theta1*theta2*sigma^2))*(cos(2*pi*omega))+
2((theta2*sigma^2)*(cos(4*pi*omega))))

Also sigma, theta1, theta2, and omega have all been defined. Where is my mistake? Thank you.

Gru
  • 95
  • 1
  • 7
  • `2*(theta1*(sigma^2)` and `2*((theta2*sigma^2)*(cos(4*pi*omega))))`. and you're gonna need omega to be defined as well – Jake Burkhead Nov 08 '13 at 03:05
  • I literally just found the error. I did define omega but you were right about the left out multiplicatives. Thank you! – Gru Nov 08 '13 at 03:08

0 Answers0