Fail to get convergence

48 views
Skip to first unread message

Saang-Yoon

unread,
Nov 2, 2014, 8:49:50 PM11/2/14
to admb-...@googlegroups.com
Hi.   There was no error in compile-link for the attached TPL file; i.e., I got its executable file.    However, I fail to get convergence results.     Would you mind checking the TPL? 
Following are commands for runs.  

admb -r -s ssmbr3v4.tpl
ssmbr3v4 -ind simdataall2.dat -ainp ssmbr3v3.pin -phase 1 -noinit
ssmbr3v4 -ind simdataall2.dat -ainp ssmbr3v3.pin -phase 9 -noinit

Thank you.
Saang-Yoon
ssmbr3v4.TPL
simdataall2.DAT
ssmbr3v3.PIN

dave fournier

unread,
Nov 3, 2014, 2:58:49 PM11/3/14
to admb-...@googlegroups.com
What makes you think the covariance matrix will be positive definite with your parameterization?

Saang-Yoon

unread,
Nov 4, 2014, 5:58:46 PM11/4/14
to admb-...@googlegroups.com
Hi, Dr. Fournier.   Thank you very much for your reply.   Attached is models that reflect the TPL code.   At the moment, I have no clue about why the covariance matrix is not positive definite.   
Saang-Yoon
DFournier141104.pdf

dave fournier

unread,
Nov 4, 2014, 6:30:56 PM11/4/14
to admb-...@googlegroups.com
On 11/04/2014 02:58 PM, Saang-Yoon wrote:

Hmm.  Well its like this. Pick a number between -infinity and + infinity. Why would you expect that it would need to be positive.

or a matrix like

  1 .9 .9
.9 1 -.50
.9 -.50 1

If you check you will see that just like -1 is negative, this matrix is not positive definite.

What you should be asking is how does one parameterize the positive definite matrices in a
nice way to do nonlinear parameter estimation. 



--
You received this message because you are subscribed to the Google Groups "admb-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to admb-users+...@googlegroups.com.
To post to this group, send email to admb-...@googlegroups.com.
Visit this group at http://groups.google.com/group/admb-users.
For more options, visit https://groups.google.com/d/optout.

Saang-Yoon

unread,
Nov 5, 2014, 8:10:38 PM11/5/14
to admb-...@googlegroups.com, da...@otter-rsch.com
Hi, Dr. Fournier and others. 
I made some progress.   Exploring many possibilities, I found that the following assumptions help, but there is still a concern.
(Assumption 1) Three age classes are not from the same cohort, and thus age class 1 and 3 are presumed to be independent.    Thus I fix the correlation coefficient between age class 1 and 3 as zero. 
(Assumption 2) If there is a correlation between neighbor age classes (e.g., "1 vs. 2", and "2 vs. 3"), the correlation should be positive (i.e. autocorrelation over the years).    Thus I set bounds of correlation between those neighbor classes to be positive: (e.g.,  init_bounded_number corp12(0.0,0.7,3);  )

Then now I have the resultant COR file (i.e., convergence was made).  It was good news, but the estimates of correlation coefficients between neighbor age classes are stuck to the uppder bound, 0.7.  If I allow a wide bound (e.g., init_bounded_number corp12(0.0,0.9,3); ), then I failed to get positive definite matrices.  

admb -r -s ssmbr3v4.tpl
ssmbr3v4 -ind simdataall2.dat -ainp ssmbr3v3.pin -phase 1 -noinit

Any advice would be appreciated.    Best Wishes,
Saang-Yoon
ssmbr3v4.TPL
simdataall2.DAT
ssmbr3v3.PIN

dave fournier

unread,
Nov 6, 2014, 10:23:45 AM11/6/14
to admb-...@googlegroups.com, us...@admb-project.org
On 11/05/2014 05:10 PM, Saang-Yoon wrote:

As I said, you should work with the Choleski decomposition of the correlation matrix.

In the simple 3x3 case your conditions imply that  it is determined by 2 parameters

r and s   with bounds a and b such that   a<=r<=b.  You get a and b by solving

     0.0<=     r/sqrt(1+r*r)  <=0.7
 
The matrix is

    1                               0                           0

     r/sqrt(1+r*r)    1/sqrt(1+r*r)                0

      0                     s/sqrt(1+s*s)    1/sqrt(1+s*s)     







H. Skaug

unread,
Nov 6, 2014, 10:30:11 AM11/6/14
to admb-...@googlegroups.com, us...@admb-project.org

Saang-Yoon

unread,
Nov 11, 2014, 12:23:12 AM11/11/14
to admb-...@googlegroups.com, us...@admb-project.org
Hi, Dr. Fournier and Hans.
Attached are two TPL files:
(1)  ssmbr3v3.TPL, which is based on Hans' link below (i.e., the page in the ADMB manual).
(2)  ssmbr3v4.TPL, which is based on Dr. Fournier's suggestion below.
Although both files still fail to generate its corresponding COR file,  the 1st TPL (i.e., ssmbr3v3.TPL) is better than the 2nd TPL (i.e., ssmbr3v4.TPL).    Would you mind checking those attached TPL files?    FYI, following are the command for run: 

admb -r -s ssmbr3v3.tpl
ssmbr3v3 -ind simdataall2.dat -ainp ssmbr3v3.pin -phase 3 -noinit

admb -r -s ssmbr3v4.tpl
ssmbr3v4 -ind simdataall2.dat -ainp ssmbr3v4.pin -phase 3 -noinit

Again thank you very much.
Saang-Yoon
ssmbr3v3.TPL
ssmbr3v4.TPL
simdataall2.DAT
ssmbr3v3.PIN
ssmbr3v4.PIN

dave fournier

unread,
Nov 11, 2014, 10:36:09 AM11/11/14
to admb-...@googlegroups.com, us...@admb-project.org
On 11/10/2014 09:23 PM, Saang-Yoon wrote:
Hi, Dr. Fournier and Hans.
Attached are two TPL files:
(1)  ssmbr3v3.TPL, which is based on Hans' link below (i.e., the page in the ADMB manual).
(2)  ssmbr3v4.TPL, which is based on Dr. Fournier's suggestion below.
Although both files still fail to generate its corresponding COR file,  the 1st TPL (i.e., ssmbr3v3.TPL) is better than the 2nd TPL (i.e., ssmbr3v4.TPL).    Would you mind checking those attached TPL files?    FYI, following are the command for run: 

admb -r -s ssmbr3v3.tpl
ssmbr3v3 -ind simdataall2.dat -ainp ssmbr3v3.pin -phase 3 -noinit

admb -r -s ssmbr3v4.tpl
ssmbr3v4 -ind simdataall2.dat -ainp ssmbr3v4.pin -phase 3 -noinit

Again thank you very much.
Saang-Yoon

The code for the choleski factor should look more like this.
I changed both and the model runs fine.


 dvar_matrix L(1,nages,1,nages);       // Cholesky factor
  L.initialize();
  L(1,1)=1;
  L(2,1)=rp/sqrt(1+rp*rp);
  L(2,2)=1/sqrt(1+rp*rp);
  L(3,2)=sp/sqrt(1+sp*sp);
  L(3,3)=1/sqrt(1+sp*sp);

However the bounds on rp and ro are probably not what you want.

Saang-Yoon

unread,
Nov 11, 2014, 12:07:04 PM11/11/14
to admb-...@googlegroups.com, us...@admb-project.org, da...@otter-rsch.com
Dr. Fournier.   Yes, it runs!!!  GREAT!!!  Thank you very much for your help.
Saang-Yoon

Saang-Yoon

unread,
Nov 11, 2014, 6:10:46 PM11/11/14
to admb-...@googlegroups.com, us...@admb-project.org, da...@otter-rsch.com
Hi, Dr. Fournier.
I changed the subject to "parameterization of Cholesky factor".    Although your parameterization works, I wonder about how you got it, because it is different from the standard method.   What I mean with "standard" method is:

Cmat  =   1       r     0   
               r       1      s
               0       s      1
where Cmat is a correlation matrix in my TPL.    

To make sure that "L*trans(L) = Cmat,"  L must be

L  =     1                        0                           0
           r               sqrt(1-r*r)                       0
           0            s/sqrt(1-r*r)         sqrt(1-r*r-s*s)/sqrt(1-r*r)


When I implemented this Cholesky factor (which is what I got from the standard method), I fail to get COR file.   My core question is how you got the following:

L =        1                               0                           0


          r/sqrt(1+r*r)         1/sqrt(1+r*r)                   0
 
            0                       s/sqrt(1+s*s)       1/sqrt(1+s*s)     


Again thank you very much for your help.
Saang-Yoon

Saang-Yoon

unread,
Nov 12, 2014, 12:58:23 PM11/12/14
to admb-...@googlegroups.com, us...@admb-project.org, da...@otter-rsch.com
Hi, Dr. Fournier.
I elaborate my question below.   Following your Cholesky factor,

  L =            1                               0                           0

             r/sqrt(1+r*r)           1/sqrt(1+r*r)                   0
 
                  0                       s/sqrt(1+s*s)       1/sqrt(1+s*s)     


we will see its resultant correlation matrix will be:

 Cmat =          1                           r/sqrt(1+r*r)                            0

                  r/sqrt(1+r*r)                        1                           s/sqrt( (1+r*r)*(1+s*s))

                       0                       s/sqrt( (1+r*r)*(1+s*s))               1


I understand your Cholesky factor, L.   But I wonder about *how* you came up with L first.  Usually we have a positive definite matrix (e.g., Cmat), *and then* we can get its Cholesky factor.   My parameterization below follows such a standard step.   But your brilliant ideas is opposite to the standard step.   Again thank you very much.
Saang-Yoon

dave fournier

unread,
Nov 15, 2014, 11:01:32 AM11/15/14
to us...@admb-project.org
Actually using the choleski decomp to parameterize the covariance matrix
is an old idea.

see Pinheiro and Bates.

http://scholar.google.ca/scholar_url?hl=en&q=ftp://netlib.bell-labs.com/cm/ms/departments/sia/project/nlme/Parametrizations.ps&sa=X&scisig=AAGBfm1_xR0qo8qRKtNN4lEoPa6KZy0Yag&oi=scholarr&ei=x3RnVO3kJMjvigKtiYH4CQ&ved=0CBsQgAMoADAA

But what is new in my approach is the particular parameterization used
for the choleski decomp of the correlation
matrix. P and B suffer from an inability to deal with dependent
variables. This is the common R failing which
permeates the entire R approach to nonlinear parameter estimation.

I note that P and b remark that there are multiple choleski decomps of
the covariance matrix leading to the same
covariance matrix and this may cause difficulties. I believe that by
starting with the correlation matrix and
then scaling it by the std devs parameterized on the log scale leads
to a unique parameterization. So I think the entire thing
is superior to anything P and B did.

I suppose I should have published it but reviewers suck so bad they ruin
my day.
_______________________________________________
Users mailing list
Us...@admb-project.org
http://lists.admb-project.org/mailman/listinfo/users
Reply all
Reply to author
Forward
0 new messages