View source: R/bage_ssvd-methods.R
| generate.bage_ssvd | R Documentation |
Generate random age or age-sex profiles from
an object of class "bage_ssvd". An object
of class "bage_ssvd" holds results from
an SVD decomposition of demographic
data.
## S3 method for class 'bage_ssvd'
generate(
x,
v = NULL,
n_draw = 20,
n_comp = NULL,
indep = NULL,
age_labels = NULL,
...
)
x |
An object of class |
v |
Version of data to use. |
n_draw |
Number of random draws to generate. |
n_comp |
The number of components.
The default is half the total number of
components of |
indep |
Whether to use independent or
joint SVDs for each sex/gender, if the
data contains a sex/gender variable.
The default is to use independent SVDs.
To obtain results for the total population
when the data contains a sex/gender variable,
set |
age_labels |
Age labels for the desired age or age-sex profile. If no labels are supplied, the most detailed profile available is used. |
... |
Unused. Included for generic consistency only. |
A tibble
HMD Mortality rates from the
Human Mortality Database.
HFD Fertility rates from the
Human Fertility Database.
LFP Labor forcce participation
rates from the OECD.
components() Components used by SVD prior.
SVD() SVD prior for term involving age.
SVD_AR1(), SVD_AR(), SVD_RW(), SVD_RW2()
Dynamic SVD priors for terms involving age and time.
poputils::age_labels() Generate age labels.
## females and males modeled independently
generate(HMD)
## joint model for females and males
generate(HMD, indep = FALSE)
## SVD for females and males combined
generate(HMD, indep = NA)
## specify age groups
labels <- poputils::age_labels(type = "lt", max = 60)
generate(HMD, age_labels = labels)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.