[ADMB Users] Application of 'sort' function to variables

kvk fromdustreturned at gmail.com
Tue Apr 27 12:30:52 PDT 2010


Thanks, Dave! I have the original running even as we speak, and I'll
experiment with the second script as well once I see the results and
whether I get any error codes.

Mike, I'm running an age-structured multispecies fisheries model that
specifically estimates predation as a function of predator-prey
abundances and size/species preferences. The base model runs fine, and
I am now attempting to include various predator functional responses.
A Hollings Type III response is a sigmoid curve, basically 1/(1+e^-
(x)).

So for my purposes, for each year, I am setting x = abundance(prey,
species i, age a) / abundance (all prey, all species, all ages). The
problem with that, however, is that 'x' is always positive between 0
and 1. So if I extract the median of 'abundance (all prey, all
species, all ages)' and subtract that median from each x value, I have
a vector of values that is evenly divided between negative and
positive. The resulting sigmoid appears to be correct in terms of
affecting overall predation, and I've integrated it into the predation
equations. It's running right now so I'll see what it returns.

I might have to re-think it in any case because of the increase in
model run time, but we'll see.

On Apr 26, 3:11 pm, Mike Prager <mike.pra... at mhprager.com> wrote:
> Are you trying to implement least median of squares?
>
> kvk wrote on 4/26/2010 5:03 PM:
>
> > So in light of that, how might I approach extracting the median of an
> > unordered vector? I could define it as a variable and minimize the sum
> > of the absolute deviations of each vector member from the median, but
> > that seems clumsy and I'm not sure how I would approach minimizing
> > that variable.
>
> > On Apr 21, 7:50 am, dave fournier<ot... at otter-rsch.com>  wrote:
>
> >> It would be simple to modify the dmatrix version to sort dvariables, but
> >> in practice most applications would probably not be differentiable.
> >> _______________________________________________
> >> Users mailing list
> >> Us... at admb-project.orghttp://lists.admb-project.org/mailman/listinfo/users
>
> >> --
> >> You received this message because you are subscribed to the Google Groups "admb-users" group.
> >> To post to this group, send email to admb-users at googlegroups.com.
> >> To unsubscribe from this group, send email to admb-users+unsubscribe at googlegroups.com.
> >> For more options, visit this group athttp://groups.google.com/group/admb-users?hl=en.
>
> > _______________________________________________
> > Users mailing list
> > Us... at admb-project.org
> >http://lists.admb-project.org/mailman/listinfo/users
>
> _______________________________________________
> Users mailing list
> Us... at admb-project.orghttp://lists.admb-project.org/mailman/listinfo/users
>
> --
> You received this message because you are subscribed to the Google Groups "admb-users" group.
> To post to this group, send email to admb-users at googlegroups.com.
> To unsubscribe from this group, send email to admb-users+unsubscribe at googlegroups.com.
> For more options, visit this group athttp://groups.google.com/group/admb-users?hl=en.



More information about the Users mailing list