njtierney / yahtsee

Yet Another Hierachical Time Series Extension and Expansion
http://yahtsee.njtierney.com/
Other
2 stars 1 forks source link

Add examples for using `scale = vec` arguments for weighting of observations #46

Open njtierney opened 3 years ago

njtierney commented 3 years ago

Documentation currently says:

How to allow weighting of observations? To weight your observations, say when using empirical logit, you must provide a vector of variances, for each observation, which represents the uncertainty of measurement. You can do this, provided the family = "gaussian", add the argument, scale = vec, to fit_hts, where vec is a vector of variances for each observation.

But I don't provide any worked examples of how to do this. I think the scale term belongs in the ... list at the end of the fit_hts function.

e.g.,

m <- fit_hts(
formula = pr ~ avg_lower_age + hts(who_subregion, country),
.data = malaria_africa_ts,
family = "gaussian",
special_index = month_num,
list(scale = vec)
)