Hello,
I try to estimate a growth model with Markov-switching models with AR(1) with both expansion and recession states. That is two states, expansion and recession.
I get the error
The code I run is :
The theoretical background is a model with a latent unit root; (AR(1)).
All variables in the model are endogenous with a single lag
Data sample is below.
Thanks for any help!
Mario
[CODE]
* Example generated by -dataex-. For more info, type help dataex
clear
input float(year gdp_g rain)
1945 . 1
1946 . .9972528
1947 . .9980889
1948 . .9615384
1949 . .993081
1950 . .992267
1951 4.368974 .9502442
1952 3.166667 .9955353
1953 4.2041025 .9815832
1954 3.747949 .9855515
1955 4.621282 .9871795
1956 3.6202564 .9950279
1957 3.802564 .996744
1958 2.4289474 .9734432
1959 3.84359 .9708995
1960 4.145641 1
1961 4.126154 .9675417
1962 4.0646152 .9976317
1963 4.5764103 .969496
1964 4.854103 .9722375
1965 4.299487 1
1966 3.906923 .9927331
1967 4.1284614 .9595888
1968 4.664359 .9677419
1969 5.080513 .9677419
1970 4.200513 .9622474
1971 4.272826 .9621588
1972 3.957447 .9406098
1973 4.0885105 .9263393
1974 2.440638 .9370707
1975 1.0009303 .9783654
1976 3.4987235 .9853051
1977 2.846522 .9867347
1978 2.955532 .9846154
1979 2.0948937 .9394796
1980 1.2640425 .9987913
1981 1.2 .9974144
1982 1.9678724 .9786684
1983 1.5117022 .9928895
1984 2.570638 1
1985 .9210638 1
1986 2.248085 1
1987 1.0723404 .9941823
1988 2.2489362 .9896051
1989 2.1693618 .9966871
1990 .25382978 .994654
1991 -.2125532 .9749401
1992 .317234 .9999377
1993 1.3534043 .9604037
1994 2.612128 .9677929
1995 3.358936 .9669732
1996 2.3597872 .9697465
1997 3.0414894 .9518272
1998 1.793617 .9739011
1999 1.8717022 .9756181
2000 3.385532 .9853424
2001 2.0512767 .9921017
2002 2.913404 .982967
2003 3.017021 .985989
2004 3.321915 1
2005 2.6668086 1
2006 2.732766 .9806319
2007 2.8740425 .9940829
2008 .04914893 1
2009 -.9074468 .9828658
2010 2.887234 .9681467
2011 1.4131914 .9968072
2012 .9474468 .9703073
2013 1.3274468 .972676
2014 .8512766 .9808435
2015 2.0059574 .
2016 .59042555 .
2017 1.825532 .
2018 1.508298 .
2019 .9170213 .
2020 1.8051064 .
end
I try to estimate a growth model with Markov-switching models with AR(1) with both expansion and recession states. That is two states, expansion and recession.
I get the error
Code:
could not calculate numerical derivatives -- discontinuous region with missing values encountered
r(430);
Code:
mswitch ar gdp_g rain ,arswitch varswitch ar(1) emiter(10000) difficult
All variables in the model are endogenous with a single lag
Data sample is below.
Thanks for any help!
Mario
[CODE]
* Example generated by -dataex-. For more info, type help dataex
clear
input float(year gdp_g rain)
1945 . 1
1946 . .9972528
1947 . .9980889
1948 . .9615384
1949 . .993081
1950 . .992267
1951 4.368974 .9502442
1952 3.166667 .9955353
1953 4.2041025 .9815832
1954 3.747949 .9855515
1955 4.621282 .9871795
1956 3.6202564 .9950279
1957 3.802564 .996744
1958 2.4289474 .9734432
1959 3.84359 .9708995
1960 4.145641 1
1961 4.126154 .9675417
1962 4.0646152 .9976317
1963 4.5764103 .969496
1964 4.854103 .9722375
1965 4.299487 1
1966 3.906923 .9927331
1967 4.1284614 .9595888
1968 4.664359 .9677419
1969 5.080513 .9677419
1970 4.200513 .9622474
1971 4.272826 .9621588
1972 3.957447 .9406098
1973 4.0885105 .9263393
1974 2.440638 .9370707
1975 1.0009303 .9783654
1976 3.4987235 .9853051
1977 2.846522 .9867347
1978 2.955532 .9846154
1979 2.0948937 .9394796
1980 1.2640425 .9987913
1981 1.2 .9974144
1982 1.9678724 .9786684
1983 1.5117022 .9928895
1984 2.570638 1
1985 .9210638 1
1986 2.248085 1
1987 1.0723404 .9941823
1988 2.2489362 .9896051
1989 2.1693618 .9966871
1990 .25382978 .994654
1991 -.2125532 .9749401
1992 .317234 .9999377
1993 1.3534043 .9604037
1994 2.612128 .9677929
1995 3.358936 .9669732
1996 2.3597872 .9697465
1997 3.0414894 .9518272
1998 1.793617 .9739011
1999 1.8717022 .9756181
2000 3.385532 .9853424
2001 2.0512767 .9921017
2002 2.913404 .982967
2003 3.017021 .985989
2004 3.321915 1
2005 2.6668086 1
2006 2.732766 .9806319
2007 2.8740425 .9940829
2008 .04914893 1
2009 -.9074468 .9828658
2010 2.887234 .9681467
2011 1.4131914 .9968072
2012 .9474468 .9703073
2013 1.3274468 .972676
2014 .8512766 .9808435
2015 2.0059574 .
2016 .59042555 .
2017 1.825532 .
2018 1.508298 .
2019 .9170213 .
2020 1.8051064 .
end