<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Circumventing a type mismatch</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.17104" name=GENERATOR></HEAD>
<BODY
style="WORD-WRAP: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space">
<DIV dir=ltr align=left><SPAN class=896592118-07122011><FONT face=Arial
color=#0000ff size=2>Steve and Larry, Thank you. The value() function solves the
problem of capturing a dif var in a regular matrix. I realize now I've seen
this function before (probably your course, Steve). Too bad I can't make it
work in the other direction. I wanted the option to replace some ogive
parameters dependent on other ogive parameters in the preliminary calcs section
(but others not). Have to type single value assignments to accomplish this. But
serves me right for forgetting value().</FONT></SPAN></DIV>
<DIV> </DIV><!-- Converted from text/rtf format -->
<UL>
<UL>
<P><SPAN lang=en-us><FONT face=Arial size=2>Mark Fowler</FONT></SPAN>
<BR><SPAN lang=en-us><FONT face=Arial size=2>Population Ecology
Division</FONT></SPAN> <BR><SPAN lang=en-us><FONT face=Arial size=2>Bedford
Inst of Oceanography</FONT></SPAN> <BR><SPAN lang=en-us><FONT face=Arial
size=2>Dept Fisheries & Oceans</FONT></SPAN> <BR><SPAN lang=en-us><FONT
face=Arial size=2>Dartmouth NS Canada</FONT></SPAN> <BR><SPAN
lang=en-us><FONT face=Arial size=2>B2Y 4A2</FONT></SPAN> <BR><SPAN
lang=en-us><FONT face=Arial size=2>Tel. (902) 426-3529</FONT></SPAN>
<BR><SPAN lang=en-us><FONT face=Arial size=2>Fax (902)
426-9710</FONT></SPAN> <BR><SPAN lang=en-us><FONT face=Arial size=2>Email
Mark.Fowler@dfo-mpo.gc.ca</FONT></SPAN> <BR><SPAN lang=en-us><FONT
face=Arial size=2>Home Tel. (902) 461-0708</FONT></SPAN> <BR><SPAN
lang=en-us><FONT face=Arial size=2>Home Email
mark.fowler@ns.sympatico.ca</FONT></SPAN> </P></UL></UL>
<DIV> </DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Steve Martell
[mailto:martell.steve@gmail.com] <BR><B>Sent:</B> December 7, 2011 2:09
PM<BR><B>To:</B> Fowler, Mark<BR><B>Cc:</B>
users@admb-project.org<BR><B>Subject:</B> Re: [ADMB Users] Circumventing a type
mismatch<BR></FONT><BR></DIV>
<DIV></DIV>Mark,
<DIV><BR></DIV>
<DIV>Based on the definitions of the variables you have defined in the
DATA_SECTION and PARAMETER_SECTIONS, it appears that your trying to overwrite
data-type variables with values from the differentiable variables. I would
try in the PRELIMINARY_CALCS_SECTION or procedure section:</DIV>
<DIV><BR></DIV>
<DIV>now_values=value(par_values);</DIV>
<DIV><BR></DIV>
<DIV>the value function will allow you to overwirte a Data type variable with
the values from the dvar_matrix.</DIV>
<DIV><BR></DIV>
<DIV>Steve</DIV>
<DIV>
<DIV>
<DIV>On 2011-12-07, at 9:37 AM, Fowler, Mark wrote:</DIV><BR
class=Apple-interchange-newline>
<BLOCKQUOTE type="cite">
<META content="MS Exchange Server version 6.5.7654.12" name=Generator>
<DIV><!-- Converted from text/rtf format -->
<P><FONT face=Arial size=2>I'm looking for a convenient way to bypass a type
mismatch in data objects. I know go-arounds for this but they require lots of
typing, I'm hoping for a simple translation syntax solution, or maybe a format
definition I haven't come across.</FONT></P>
<P><FONT face=Arial size=2>Example</FONT> </P>
<P><FONT face=Arial size=2>Define a matrix in the DATA_SECTION</FONT> </P>
<P><FONT face=Arial size=2> matrix
now_values(1,n_values,1,2)</FONT> </P>
<P><FONT face=Arial size=2>Define another matrix in the PARAMETER_SECTION (so
type dvar)</FONT> </P>
<P><FONT face=Arial size=2> matrix par_values(1,n_values,1,2)</FONT>
</P>
<P><FONT face=Arial size=2>Capture or create values of par_values in
PRELIMINARY_CALCS_SECTION. Something like</FONT> </P>
<P><FONT face=Arial
size=2>now_values=justgimmethecurrentnumbers(par_values);</FONT> </P>
<P><FONT face=Arial size=2>Or</FONT> </P>
<P><FONT face=Arial size=2>par_values=dvarwannabe(now_values);</FONT> </P>
<P><FONT face=Arial size=2>Seeking a simple way to keep track of associated
initial and fitted values in outputs, or alternatively pass computed initial
values from a suite of choices to a parameter object. Inspired by hordes of
ogives.</FONT></P>
<UL>
<UL>
<P><SPAN lang=en-us><FONT face=Arial size=2>Mark Fowler</FONT></SPAN>
<BR><SPAN lang=en-us><FONT face=Arial size=2>Population Ecology
Division</FONT></SPAN> <BR><SPAN lang=en-us><FONT face=Arial
size=2>Bedford Inst of Oceanography</FONT></SPAN> <BR><SPAN
lang=en-us><FONT face=Arial size=2>Dept Fisheries &
Oceans</FONT></SPAN> <BR><SPAN lang=en-us><FONT face=Arial
size=2>Dartmouth NS Canada</FONT></SPAN> <BR><SPAN lang=en-us><FONT
face=Arial size=2>B2Y 4A2</FONT></SPAN> <BR><SPAN lang=en-us><FONT
face=Arial size=2>Tel. (902) 426-3529</FONT></SPAN> <BR><SPAN
lang=en-us><FONT face=Arial size=2>Fax (902) 426-9710</FONT></SPAN>
<BR><SPAN lang=en-us><FONT face=Arial size=2>Email <A
href="mailto:Mark.Fowler@dfo-mpo.gc.ca">Mark.Fowler@dfo-mpo.gc.ca</A></FONT></SPAN>
<BR><SPAN lang=en-us><FONT face=Arial size=2>Home Tel. (902)
461-0708</FONT></SPAN> <BR><SPAN lang=en-us><FONT face=Arial size=2>Home
Email <A
href="mailto:mark.fowler@ns.sympatico.ca">mark.fowler@ns.sympatico.ca</A></FONT></SPAN>
</P><BR></UL></UL></DIV>_______________________________________________<BR>Users
mailing list<BR><A
href="mailto:Users@admb-project.org">Users@admb-project.org</A><BR>http://lists.admb-project.org/mailman/listinfo/users<BR></BLOCKQUOTE></DIV><BR></DIV><BR><BR>
<DIV><SPAN class=Apple-style-span
style="WORD-SPACING: 0px; FONT: medium Helvetica; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">
<DIV><I>A computer lets you make more mistakes faster than any invention in
human history - with the possible exceptions of handguns and
tequila....</I></DIV>
<DIV><BR></DIV></SPAN><BR
class=Apple-interchange-newline></DIV><BR></BODY></HTML>