<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
I do not see any selectivity curvature penalty in the objective
function, so depending on how informative your data are, the estimation
may drift into nonsensical parameter space, which could then cause the
Hessian problem. The problem is probably exacerbated by the use of
unbounded parameters: init_vector log_sel1(1,nNodes) //
SPLINES<br>
<br>
<br>
Poos, Jan Jaap wrote:
<blockquote
cite="mid:605CF62A79C32E4AA0CC741FD84D4E7425E71709E3@scomp0536.wurnet.nl"
type="cite">
<pre wrap="">Hi Steve Martell,
Although indeed the problem may be in the code, this part should work. There is no if else statement here. The second if statement is nested within the first else statement. This part is only evaluated if i >36.
Kind regards, Jan Jaap
-----Original Message-----
From: <a class="moz-txt-link-abbreviated" href="mailto:users-bounces@admb-project.org">users-bounces@admb-project.org</a> [<a class="moz-txt-link-freetext" href="mailto:users-bounces@admb-project.org">mailto:users-bounces@admb-project.org</a>] On Behalf Of Steve Martell
Sent: Wednesday, March 02, 2011 4:52 PM
To: Luis Ridao
Cc: <a class="moz-txt-link-abbreviated" href="mailto:users@admb-project.org">users@admb-project.org</a>
Subject: Re: [ADMB Users] spline smoother on selectivity (even shorter version)
I suspect this part of the code is causing some of the problems.
for(i=1;i<=nyrs;i++)
{
if (i<=36)
{
F(i)=mfexp(log_fy(i))*mfexp(predSel1);
}
else
{
if (i<=44)
F(i)=mfexp(log_fy(i))*mfexp(predSel2);
else
{
F(i)=mfexp(log_fy(i))*mfexp(predSel3);
}
}
}
If i is less than or equal to 36, then both conditions are true in your if else statements so preSel1 is never actually used.
On 2011-03-01, at 4:57 AM, Luis Ridao wrote:
</pre>
<blockquote type="cite">
<pre wrap="">ADMB-help,
Following Dave's suggestion on implementing a spline smoother on
selectivity (in a separable catch-at-age model) I managed to do
something like:
PARAMETER_SECTION
init_vector log_sel1(1,nNodes) // nNodes = 5 -> (1,2,3,4,5) nages = 12 -> (1,2,3,4,5,6,7,8,9,10,11,12)
sdreport_vector predSel1(1,nages)
for (i=1;i<=nyrs;i++)
{
if (i<=36)
{
vcubic_spline_function qs(nodes,log_sel1); // SPLINES
predSel1=qs(ages);
}
else
.................................
for(i=1;i<=nyrs;i++)
{
if (i<=36)
{
F(i)=mfexp(log_fy(i))*mfexp(predSel1);
}
else
.................................
The program compiles and runs without problems but when the number of "nodes"
are changed to another amount (e.g. 6) ADMB complains about Hessian:
"Warning -- Hessian does not appear to be positive definite Hessian
does not appear to be positive definite"
The model template and data files are attached
Thanks in advance
<sai09_spline.tpl><sai09_spline.dat>__________________________________
_____________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@admb-project.org">Users@admb-project.org</a>
<a class="moz-txt-link-freetext" href="http://lists.admb-project.org/mailman/listinfo/users">http://lists.admb-project.org/mailman/listinfo/users</a>
</pre>
</blockquote>
<pre wrap=""><!---->
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@admb-project.org">Users@admb-project.org</a>
<a class="moz-txt-link-freetext" href="http://lists.admb-project.org/mailman/listinfo/users">http://lists.admb-project.org/mailman/listinfo/users</a>
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@admb-project.org">Users@admb-project.org</a>
<a class="moz-txt-link-freetext" href="http://lists.admb-project.org/mailman/listinfo/users">http://lists.admb-project.org/mailman/listinfo/users</a>
</pre>
</blockquote>
</body>
</html>