From b2c901fa9645fe61c92c3a5ab4ce423751bc81ee Mon Sep 17 00:00:00 2001 From: Hana Sevcikova Date: Thu, 7 Nov 2024 13:34:07 -0800 Subject: [PATCH] documentation --- man/get.mig.trajectories.Rd | 28 +++++++++++ man/mig.adjust.Rd | 93 +++++++++++++++++++++++++++++++++++++ 2 files changed, 121 insertions(+) create mode 100644 man/get.mig.trajectories.Rd create mode 100644 man/mig.adjust.Rd diff --git a/man/get.mig.trajectories.Rd b/man/get.mig.trajectories.Rd new file mode 100644 index 0000000..8fc5d4c --- /dev/null +++ b/man/get.mig.trajectories.Rd @@ -0,0 +1,28 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/get_outputs.R +\name{get.mig.trajectories} +\alias{get.mig.trajectories} +\title{Accessing Trajectories of Net Migration Rate} +\usage{ +get.mig.trajectories(mig.pred, country) +} +\arguments{ +\item{mig.pred}{Object of class \code{\link{bayesMig.prediction}}.} + +\item{country}{Name or numerical code of a country. It can also be given as +ISO-2 or ISO-3 characters.} +} +\value{ +Array of size the number of projection periods (including the present year) times the number of trajectories. +} +\description{ +Function for accessing all future trajectories of the net migration rate + from a prediction object in a form of an array. +} +\details{ +The function loads projected trajectories of net migration rate for the given country from disk + and returns it as a matrix. +} +\seealso{ +\code{\link{bayesMig.prediction}}, \code{\link{get.mig.prediction}}, \code{\link{mig.trajectories.table}} +} diff --git a/man/mig.adjust.Rd b/man/mig.adjust.Rd new file mode 100644 index 0000000..78c8a48 --- /dev/null +++ b/man/mig.adjust.Rd @@ -0,0 +1,93 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/predict_mig.R +\name{mig.median.set} +\alias{mig.median.set} +\alias{mig.median.shift} +\alias{mig.median.reset} +\alias{mig.align.predictions} +\title{Adjusting the Projection Medians} +\usage{ +mig.median.set(sim.dir, country, values, years = NULL, ...) + +mig.median.shift( + sim.dir, + country, + reset = FALSE, + shift = 0, + from = NULL, + to = NULL +) + +mig.median.reset(sim.dir, countries = NULL) + +mig.align.predictions( + sim.dir1, + sim.dir2, + country.codes = NULL, + years = NULL, + ... +) +} +\arguments{ +\item{sim.dir}{Directory containing the prediction object.} + +\item{country}{Name or numerical code of a country.} + +\item{values}{Vector of the new median values.} + +\item{years}{Numeric vector giving years for which to change the median. +In \code{mig.median.set} it gives years which \code{values} correspond to. +Ideally it should be of the same length as \code{values}. If it is \code{NULL}, +\code{values} are set starting from the first prediction time period. +If \code{values} correspond to consecutive years, only the first year might be given here. +In \code{mig.align.predictions} it gives years for which the medians should be aligned.} + +\item{\dots}{Additional arguments passed to the underlying adjustment function. +It can be \code{verbose} to show/hide the progress of the adjustment.} + +\item{reset}{Logical. If \code{TRUE} medians in a range of \code{from} and \code{to} are +reset to their original values.} + +\item{shift}{Constant by which the medians should be offset. It is not used if \code{reset} is \code{TRUE}.} + +\item{from}{Year from which the offset/reset should start. By default, it starts at the first prediction period.} + +\item{to}{Year until which the offset/reset should be done. By default, it is set to the last prediction period.} + +\item{countries}{Vector of country names or codes. If this argument is \code{NULL} (default), +the reset is done for all countries.} + +\item{sim.dir1}{Directory with the bayesMig prediction object to be adjusted.} + +\item{sim.dir2}{Directory with the bayesMig prediction object used to align the medians from \code{sim.dir1} to.} + +\item{country.codes}{Numerical codes of countries to adjust. By default all countries +found in \code{sim.dir2} are adjusted in \code{sim.dir1}.} +} +\value{ +All functions return an updated object of class \code{\link{bayesMig.prediction}}. +} +\description{ +These functions are to be used by expert analysts. They allow to + change the projection medians either to specific values, or shift the medians + by a given constant or align one projection object with another. +} +\details{ +The function \code{mig.median.set} can be used to set the medians of the + given country to specific values. + +Function \code{mig.median.shift} can be used to offset the medians by a specific constant, or to reset + the medians to their original values. + +Function \code{mig.median.reset} resets medians of the given countries + to the original values. By default it deletes adjustments for all countries. + +Function \code{mig.align.predictions} shifts medians stored in \code{sim.dir1} to match + the medians in \code{sim.dir1}. + + In all cases, if a median is modified, the corresponding offset is stored in the prediction object + (element \code{median.shift}). All functions write the updated prediction object back to disk. All + functions in the package that use trajectories and trajectory statistics use the \code{median.shift} + values to offset the results correspondingly, i.e. trajectories are shifted the same way as the + medians. +}