# [R] matrix which results singular but at the same time positive definite

Stefano Sofia stefano.sofia at regione.marche.it
Mon Dec 28 17:11:57 CET 2015

```Dear Dr.Gilbert,

it took me a bit of time to understand your thoughtful comment.
You are right on everything. I was not able to see it, and likely I still have something to understand better some consequences on what I am trying to do.

Thank you
Stefano

________________________________________
Da: Paul Gilbert [pgilbert902 at gmail.com]
Inviato: martedì 15 dicembre 2015 15.28
A: Stefano Sofia
Cc: r-help at r-project.org; Fox, John; peter dalgaard
Oggetto: Re: [R] matrix which results singular but at the same time positive definite

Stefano

I think in other response to in this thread you got the answer to the
question you asked, but you may be asking the wrong question. I'm not
familiar with the specific papers you mention and you have not provided
enough detail about what you are doing, so I am guessing a bit. The term
"dynamic linear model" can refer to both linear ARMA/ARIMA models and to
linear state-space models, however some authors use it to refer
exclusively to state-space models and from your phrasing I am guessing
you are doing that. There would be many state-space models equivalent to
a given ARMA/ARIMA model, but without specifying structural aspects of
the system you will likely be using one of the innovations form
state-space models that are equivalent. In an innovations form
state-space model the state is defined as an expectation. From a
practical point of view, this is one of the most important differences
between an innovation form and a non-innovations form state-space model.
Since the expectation is known exactly, the state-tracking error is
zero. That means the covariance matrix from the filter or smoother
should be a zero matrix, which you should not be trying to invert. In a
non-innovations form the state has a physical interpretation rather than
being an expectation, so the state tracking error should not be
degenerate in that case.

I mention all this because your covariance matrix looks very close to zero.

Paul Gilbert

On 12/11/2015 06:00 AM, r-help-request at r-project.org wrote:
> Dear John, thank you for your considerations. This matrix (which is a
> variance matrix) is part of an algorithm for forward-filtering and
> backward-sampling of Dynamic Linear Models (West and Harrison, 1997),
> applied to DLM representation of ARIMA processes (Petris, Petrone,
> Campagnoli).  It is therefore very difficult to explain why this
> variance matrix becomes so ill conditioned. This already happens at
> the first iteration of the algorithm. I will try to work on initial
> conditions and some fixed parameters.
>
> Thank you again Stefano
>

________________________________

AVVISO IMPORTANTE: Questo messaggio di posta elettronica può contenere informazioni confidenziali, pertanto è destinato solo a persone autorizzate alla ricezione. I messaggi di posta elettronica per i client di Regione Marche possono contenere informazioni confidenziali e con privilegi legali. Se non si è il destinatario specificato, non leggere, copiare, inoltrare o archiviare questo messaggio. Se si è ricevuto questo messaggio per errore, inoltrarlo al mittente ed eliminarlo completamente dal sistema del proprio computer. Ai sensi dell’art. 6 della DGR n. 1394/2008 si segnala che, in caso di necessità ed urgenza, la risposta al presente messaggio di posta elettronica può essere visionata da persone estranee al destinatario.
IMPORTANT NOTICE: This e-mail message is intended to be received only by persons entitled to receive the confidential information it may contain. E-mail messages to clients of Regione Marche may contain information that is confidential and legally privileged. Please do not read, copy, forward, or store this message unless you are an intended recipient of it. If you have received this message in error, please forward it to the sender and delete it completely from your computer system.
```