Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: State Space Question


From   Ryan Riordan <ryan.riordan@kit.edu>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: State Space Question
Date   Mon, 11 Apr 2011 16:30:49 +0200

Hi,

I am trying to implement a state space model using sspace in Stata. The
model has the following structure:

P_t = M_t + S_t
M_t = M_t-1 + U_t
U_t = Vol_hat_t + W_t
S_t = Phi*S_t-1 + Vol_t + E_t

Where Vol_hat_t is a variable with autocorrelation removed and Vol_t is the
raw variable. I have tried the following:

constraint 1 [m]L.m = 1
constraint 2 [mid]m = 1
constraint 3 [mid]u = 1
sspace (m L.m vol_hat, noconst state) (u L.u vol, noconst state) (mid m u,
noconst noerror), constraints(1 2 3) covstate(diagonal) iter(100)
method(kdiff)

And get the following error:

"may not include observed dependent variables in state equations"

Perhaps someone here has an idea of what I have misspecified above.

Thanks,
Ryan.



On 11-04-11 4:20 PM, "Nick Cox" <njcoxstata@gmail.com> wrote:

> What embedded quotes are you referring to?
> 
> When you define
> 
> local title "Database Analysis"
> 
> the double quote characters " " do not become part of the macro. They
> are just treated as delimiters for the string. Following precisely the
> line above with
> 
> mac li
> 
> will show that. So, my comment remains as it was. Glad you solved your
> problem, but it is not clear why what you did failed to work in the
> first place.
> 
> Nick
> 
> On Mon, Apr 11, 2011 at 3:10 PM, Data Analytics Corp.
> <walt@dataanalyticscorp.com> wrote:
>> Sounds like the embedded quotes were getting me the wrong answer.  It works
>> now.
>> 
>> Thanks,
>> 
>> Walt
>> 
>> On 4/11/2011 9:25 AM, Eric Booth wrote:
>>> 
>>> <>
>>> 
>>> Wrapping in graph titles (or axis labels, notes, captions, etc) occurs
>>> when there are embedded
>>> quotes in the title, so "Database Analysis" will not wrap, `" " Database"
>>> "Analyses" "' will wrap.
>>> 
>>> Modifying Maarten's example, here's the wrapping:
>>> 
>>> *-------------- begin example ---------------
>>> sysuse auto, clear
>>> local title  " Database"  "Analysis"
>>> forvalues i = 1/5 {
>>>    scatter price mpg if rep78==`i', ///
>>>            title("`title'")         ///
>>>            name(gr`i', replace)
>>> }
>>> *--------------- end example ----------------
>>> 
>>> - Eric
>>> 
>>> __
>>> Eric A. Booth
>>> Public Policy Research Institute
>>> Texas A&M University
>>> ebooth@ppri.tamu.edu
>>> Office: +979.845.6754
>>> 
>>> 
>>> On Apr 11, 2011, at 8:15 AM, Maarten buis wrote:
>>> 
>>>> --- On Mon, 11/4/11, Data Analytics Corp. wrote:
>>>>> 
>>>>> I'm going to produce a series of graphs in which I want the
>>>>> fist line of the title to always be "Database
>>>>> Analysis".  I created a local macro as
>>>>> 
>>>>>    local title "Database Analysis"
>>>>> 
>>>>> and then in the graph commands I used
>>>>> 
>>>>>    title(`title')
>>>>> 
>>>>> But the title came out as
>>>>> 
>>>>>    Database
>>>>>    Analysis
>>>>> 
>>>>> I want the two words Database and Analysis on one line, the
>>>>> first, of each graph.  How do I specify the macro to do
>>>>> this?
>>>> 
>>>> I cannot reproduce your problem. Can you change the example
>>>> below such that it produces the behavior you reported?
>>>> 
>>>> *-------------- begin example ---------------
>>>> sysuse auto, clear
>>>> local title "Database Analysis"
>>>> forvalues i = 1/5 {
>>>>    scatter price mpg if rep78==`i', ///
>>>>            title("`title'")         ///
>>>>            name(gr`i', replace)
>>>> }
>>>> *--------------- end example ----------------
>>>> 
> 
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index