Refactoring the ODE system. . . a proposal ODEs solved in Stan have the form dy(t) = f (t, y, θ) dt with the inital condition y(t = t0 ) = y0 , which fully defines the solution y(t) at all time points t > t0 . Here the state y has N components and the parameter vector θ is of size M . However, depending on what is requested, we also need the gradients of y(t) wrt to the initials y0 and/or the parameters θ, which we construct with what is referred to usually as forward sensitivity analysis. The sensitivity of the solution wrt to a parameter pi is dy(t) dpi , which is the gradient of y(t) wrt to pi . It can be shown that the N components of this gradient are related to the base ODE system as ∂f ∂f dsi (t) ∂y0 = si + with si (t = t0 ) = . dt ∂y ∂pi ∂pi ∂f First we recognize that we always need the Jacobian wrt to the states, ∂y . Next, let’s consider these terms for the two cases sensitivities for either the initials or the parameters:

• Sensitivities for the parameters: Then the term ∂f the Jacobian wrt to the parameters, ∂θ . The state does not depend on any parameter.

∂f ∂pi is the ith column of 0 term ∂y ∂θi is 0 since the initial

∂f • Sensitivities for the initials: The term ∂p vanishes, since the solution i at time t > t0 does not depend on the initial (in fact it does, but only 0 implicitly). The term ∂y ∂pi is easiest written with the N terms collapsed to ∂y0 0 a matrix ( ∂y ∂y1 , ..., ∂yN ) which are equal to the 1N xN identity matrix.

Collpasing now the two types of sensitivities in matrix notation with the definitions Sy0 =



Sθ =

∂y ∂y , ..., ∂y0,1 ∂y0,N



∂y ∂y , ..., ∂θ1 ∂θM 1





let’s us write the coupled ODE system in a compact matrix form, i.e. dSy0 ∂f = Sy dt ∂y 0 ∂f ∂f dSθ = Sθ + . dt ∂y ∂θ Hence, for Stan we need in addition to the ODE RHS, which is f in the notation above, also always the objects • Jacobian wrt to states,

∂f ∂y

• Jacobian wrt to parameters,

∂f ∂θ

which we usually generate using autodiff. As any ODE solver used in Stan which uses the forward sensitivity approach will need the above objects, I am proposing to introduce the ode_model object. The ode_model object has as template parameter the ODE RHS system functor. As its default implementation it uses AD to generate the needed Jacobians. With template specialisations we are then able to inject analytic Jacobians into the ODE code. This will be of particular importance whenever AD becomes a performance bottleneck, i.e. for very stiff systems which need frequent evaluation of the Jacobian OR whenever the solution is requested with a high precision.

2

Refactoring the ODE system... a proposal -

y(t = t0) = y0, which fully defines the solution y(t) at all time points t>t0. Here the state y has N components and the parameter vector θ is of size M. However, ...

171KB Sizes 0 Downloads 143 Views

Recommend Documents

Ode on a Grecian Urn.pdf
Try one of the apps below to open or edit this item. Ode on a Grecian Urn.pdf. Ode on a Grecian Urn.pdf. Open. Extract. Open with. Sign In. Main menu.

VEDA (Educational Management System) proposal body.pdf ...
Page 1 of 9. WOLEISTICS. RC 1328467. PRIME LIMITED. Our Services: RMS Developers, Computer Software and Hardware Engineers. Plot 2, Close 1, Isheri-Olofin Royal Estate, Sheri-Olofin, Alimosho, Lagos State. The Educational Director, Date: ...

SASE-Submitting-a-Proposal
Log into your account at sase.org – green button “sign in” in the top right-hand corner of the homepage: ... Once you are logged in, you will see the green button “submit a paper” in the top right-hand corner of any page on the ... Conferen

Ode to joy.pdf
Page 3 of 264. Whoops! There was a problem loading this page. Retrying... Ode to joy.pdf. Ode to joy.pdf. Open. Extract. Open with. Sign In. Main menu. Displaying Ode to joy.pdf. Page 1 of 264.

Refactoring Tests in the Red
Apr 25, 2007 - With a good set of tests in place, refactoring code is much easier, as you can quickly gain a lot of confidence by running the tests again and ...

A Modest Proposal
already devoured most of the parents, seem to have the best title to the children. ... generally tough and lean, like that of our school-boys, by continual exercise, and ... work, and consequently pine away from want of nourishment, to a degree, that

A Modest Proposal
well of the public, as to have his statue set up for a preserver of the nation. .... as fast as can be reasonably expected. And as to the young .... rent without money or trade, the want of common sustenance, with neither house nor clothes to cover.

a project proposal
of a Bachelor of Science (B.Sc Hons) degree in Computer Science and Engineering,. Obafemi Awolowo ... 4.4.2 The probability of dropping packet. 48 .... Over the past few years, researchers have come out with several congestion avoidance.

A Research Proposal -
To determine how advertisement exposure response functions differ between established brands and market newcomers. Submitted To. Prof Sanjeev Verma.

Ode of Mulan.pdf
He whets the knife, quick quick, for pig and sheep. "I open the door to my east chamber,. I sit on my couch in the west room,. I take off my wartime gown. And put ...

Read [Samuel Carr Book] Ode to Flowers: A ...
celebrates the humble flower, from snowdrops and daffodils to romantic roses, colorful asters, and scented jasmine. The verses remind us of nature's gifts and ...

Request for Proposal Website Database System ... - Drupal Groups
Feb 24, 2015 - Global Citizens Network (GCN), a 501(c)(3) organization, strives to develop creative and effective local ... Social and economic injustice, racial and ethnic inequality, and ... Ability to create a full class list of participants.

Read [Samuel Carr Book] Ode to Flowers: A ...
Ode to Flowers: A Celebration of the Poetry of Flowers Samuel Carr is the editor of a series of poetry anthologies.. The verses remind us of nature's gifts and come from classic poets of all eras, including Chaucer, Shakespeare, Coleridge, Tennyson,

72. Wa Ode Rosyana T.pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. 72. Wa Ode Rosyana T.pdf. 72. Wa Ode Rosyana T.pdf. Open. Extract. Open with. Sign In. Main menu.

Seagull Merlin - Ode to Joy.pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. Seagull Merlin ...

Operator method for ODE
d2 dx2 yc(x) + b d dx yc(x) + cyc(x)=0. for the complementary function yc(x). Substitution of the trial solution yc(x) = exp(λx) in eq. [2] gives the quadratic equation aλ2 + bλ + c = 0 which has two so- lutions, λ+ and λ− given by. [3] λ± =

ODE and Google Contract.pdf
Page 1 of 9. Page 1 of 9. Page 2 of 9. Page 2 of 9. Page 3 of 9. Page 3 of 9. ODE and Google Contract.pdf. ODE and Google Contract.pdf. Open. Extract.

Jonathan Swift. A Modest Proposal
country, when they see the streets, the roads, and cabin doors, crowded with .... well as our most dangerous enemies; and who stay at home on purpose with a ...

A PROPOSAL FOR COMMUNITY DRIVEN AND ... - GitHub
Dec 4, 2012 - 1. INTRODUCTION. Astronomical catalogues and databases are almost as old as ... In recent years, the internet allowed the open source com- munity to make ..... and tools that the computer science and open source commu- nity uses. .... d