Exercise

# Probabilistic projection of migration (setup)

We'll now introduce a demographic model to be used throughout the course. It projects net migration rates via an autoregressive model (AR1). It is a typical example of an embarrassingly parallel application where a set of estimated parameters is used repeatedly for prediction. In an AR1, a future value is dependent on the past value. The process has a long term mean (`mu`

), a rate of convergence (`phi`

) to `mu`

, and an error term with standard deviation (`sigma`

). You do not need to know details of the modelling.

We have simulated 1000 samples of these three parameters (dataset `ar1est`

) and will use it to project the future distribution of migration rates. Starting from an initial rate (`rate0`

), each row of `ar1est`

can be used to generate a block of migration trajectories (using function `ar1_block_of_trajectories()`

). This process is shown in the image below (where `ar1_block_of_trajectories()`

is abbreviated with `ar1_block()`

). Combining blocks from all rows gives the final migration distribution.

Your job in this exercise is to explore the function `ar1_block_of_trajectories()`

(type `ar1_block_of_trajectories`

in your console). Its argument `id`

determines which row of `ar1est`

to use. What type of object does the function return and what do the function arguments `traj_len`

and `block_size`

correspond to in the function output?

Instructions

### Possible answers

`traj_len`

corresponds to rows and `block_size`

corresponds to columns.`traj_len`

corresponds to columns and `block_size`

corresponds to rows.`traj_len`

corresponds to list length and `block_size`

corresponds to each vector length.