[ADMB Users] bounded_vector elements

Steve Martell s.martell at fisheries.ubc.ca
Wed Nov 10 13:35:56 PST 2010


Yes read the manual on init_bounded_number_vectors

DATA_SECTION
init_int n
// ...
PARAMETER_SECTION
// need to create some vectors to hold the bounds and
// phase numbers
LOC_CALCS
dvector lb(1,n);
dvector ub(1,n);
ivector ph(1,n);
// get the desired values into lb,ub,ph somehow
lb.fill_seqadd(1,0.5);
ub.fill_seqadd(2,0.5);
ph.fill_seqadd(1,1);
END_CALCS
init_bounded_number_vector a(1,n,lb,ub,ph)

On 2010-11-10, at 1:28 PM, Mollie Brooks wrote:

> I think the answer is probably "no", but is there a way to create a bounded_vector with different bounds on different elements? 
> I need this because I store my model coefficients in a vector to be multiplied by the matrix of predictors and I want to restrict some coefficients to be positive and others negative. Maybe this could go on a to-do list?
> 
> I guess I could hack this by restricting the coefficients to be positive and making certain predictors negative in my .dat file.
> thanks,
> Mollie
> 
> 
> 
> _______________________________________________
> Users mailing list
> Users at admb-project.org
> http://lists.admb-project.org/mailman/listinfo/users

Steve Martell
s.martell at fisheries.ubc.ca



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.admb-project.org/pipermail/users/attachments/20101110/d77466cb/attachment.html>


More information about the Users mailing list