mansmeg. To fix this you can add URL: https://staffanbetner.r-universe.dev/stanpop to the package DESCRIPTION file. See also theR-universe documentation.Package: stanpop 1.0.1
stanpop: Stan-based Poll of Polls Models
Stan Models and code to run Bayesian poll of polls models.
Authors:
stanpop_1.0.1.tar.gz
stanpop_1.0.1.zip(r-4.7-any)stanpop_1.0.1.zip(r-4.6-any)stanpop_1.0.1.zip(r-4.5-any)
stanpop_1.0.1.tgz(r-4.6-any)stanpop_1.0.1.tgz(r-4.5-any)
stanpop_1.0.1.tar.gz(r-4.7-any)stanpop_1.0.1.tar.gz(r-4.6-any)
stanpop_1.0.1.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION
card.svg |card.png
stanpop/json (API)
| # Install 'stanpop' in R: |
| install.packages('stanpop', repos = c('https://staffanbetner.r-universe.dev', 'https://cloud.r-project.org')) |
Bug tracker:https://github.com/mansmeg/stanpop/issues
- german_elections - German election data
- german_party_time_ranges - Party time ranges
- german_polls - German polls data
- german_polls_curated - German polls data
- house_map - Map between houses and house names
- pd_test - A subset of swe_polls stored as a [polls_data] object
- spanish_elections - Spanish election data
- spanish_party_time_ranges - Party time ranges
- spanish_polls - Spanish polls data
- spanish_polls_curated - Spanish polls data
- swedish_elections - Swedish election data
- swedish_polls - Swedish polls data
- swedish_polls_curated - Spanish polls data
- x_test - Four true latent states used in experiments
Last updated from:458636a6c8. Checks:9 OK. Indexed: no.
| Target | Result | Time | Files | Syslog |
|---|---|---|---|---|
| linux-devel | OK | 411 | ||
| source / vignettes | OK | 254 | ||
| linux-release | OK | 352 | ||
| macos-release | OK | 292 | ||
| macos-oldrel | OK | 259 | ||
| windows-devel | OK | 333 | ||
| windows-release | OK | 352 | ||
| windows-oldrel | OK | 377 | ||
| wasm-release | OK | 165 |
Exports:as.polls_dataassert_stan_data_modelcollection_midpoint_datescomplete_poll_datacomplete_poll_infocomplete_poll_ycomplete_pollscompute_prediction_errorcreate_constrained_names_to_unconstrained_idx_mapcreate_unpar_one_to_one_mapcurate_swedish_pollsdiagnose_extract_min_eigen_value_Omegadivergent_transitions_percentileselpd_known_stateend_dateend_date<-end_datesend_dates<-existing_partiesextractextract_parameter_namesextract_poll_of_polls_input_argumentsextract_poll_of_polls_refit_argumentsextract_poll_of_polls_sample_argumentsextract_pop_election_periodextract_pop_empirical_posterior_mean_x_changegeom_collection_periodgeom_known_stategeom_latent_stategeom_polls_time_weightsgeom_pop_linegeom_publish_dategeom_stan_polls_dataget_adaptation_infoget_known_state_lookback_windowsget_known_state_periodsget_last_evaluation_infoget_latent_state_for_datesget_model_diagnosticsget_model_model_argumentsget_ndrawsget_num_parsget_num_uparsget_parameter_namesget_sampler_paramsget_stan_dateget_stancodeget_time_pointshouse_levelshousesincorrect_drawslatent_statelatent_state_abindlatent_state_applylatent_state_drawlatent_state_FUNlatent_state_meanlatent_state_mean_dateslatent_state_percentileslatent_state_sdlatent_state_subsetload_poplog_problogMeanExpmodel_argumentsmodel_confignn<-ndrawsparameter_block_namesparameter_block_names_from_unconstrained_indexparameter_namesparameter_names_from_unconstrained_indexparameter_unique_names_from_unconstrained_indexparameters_countsparty_levelspercentile_known_stateplot_parameters_areasplot_parameters_mcmc_hexplot_parameters_mcmc_intervalsplot_parameters_mcmc_scatterplot_poll_of_pollspoll_idpoll_id<-poll_idspoll_ids<-poll_of_pollspoll_predictive_distributionpolls_datapolls_time_reweightpolls_time_weightspolls_time_weights<-publish_datepublish_date<-publish_datespublish_dates<-recompile_stanfitreestimate_poll_of_pollsrefit_poll_of_pollsremove_file_extensionremove_known_statesrerun_poll_of_pollsRhat_is_above_mRhat_is_above_m_by_parameter_blockRhat_is_NARhat_is_NA_by_parameter_blockrmse_known_statesave_popsetup_latent_time_rangessimulate_pollsstan_polls_datastan_polls_data_modelstan_polls_data_model2stan_polls_data_model3stan_polls_data_model5stan_polls_data_model6stan_polls_data_model6bstan_polls_data_model7stan_polls_data_model8astan_polls_data_model8a1stan_polls_data_model8bstan_polls_data_model8cstan_polls_data_model8dstandard_errorstart_datestart_date<-start_datesstart_dates<-subset_datessubset_latent_state_datessubset_publish_datessubset_time_line_datessummarize_polls_time_weightstime_linetime_rangetime_range_pollstime_range<-time_ranges_are_disjointtime_scale_datestraceplotvalidate_backend_sample_argumentsx_predictyy_predicty<-
Dependencies:abindbackportsBHcallrcheckmateclicpp11descdigestdistributionaldplyrfarvergenericsggplot2gluegridExtragtableinlineisobandlabelinglifecycleloolubridatemagrittrmatrixStatsnumDerivotelpillarpkgbuildpkgconfigposteriorprocessxpsQuickJSRR6RColorBrewerRcppRcppEigenRcppParallelrlangrstanS7scalesStanHeaderstensorAtibbletidyselecttimechangeutf8vctrsviridisLitewithryaml
Readme and manuals
Help Manual
| Help page | Topics |
|---|---|
| Assert that the dates are available within the time_line | assert_dates_in_time_line |
| Assert that the poll_data object dates are available within the time_line | assert_poll_data_in_time_line |
| Assert that the poll_data object dates are available within the [time_line] using time_scale | assert_poll_data_in_time_line_using_time_range assert_poll_data_in_time_line_using_time_scale |
| Check Stan Data for specific model | assert_stan_data_model assert_stan_data_model.model2 assert_stan_data_model.model3 assert_stan_data_model.model4 assert_stan_data_model.model5 assert_stan_data_model.model6 assert_stan_data_model.model6b assert_stan_data_model.model8a assert_stan_data_model.model8a1 assert_stan_data_model.model8a3 assert_stan_data_model.model8b assert_stan_data_model.model8c assert_stan_data_model.model8d assert_stan_data_model.model8e assert_stan_data_model.model8f assert_stan_data_model.model8g assert_stan_data_model.model8i assert_stan_data_model.model8k assert_stan_data_model.model8l assert_stan_data_model.model8m assert_stan_data_model.model9 |
| Return indicator on polls without missing values | complete_polls complete_poll_data complete_poll_info complete_poll_y |
| Compute the default value of g_scale | compute_g_scale_default |
| Compute gamma parameters with same expectation and variances as a half-normal with parameter sigma | compute_gamma_parameters |
| Compute prediction error for a poll_of_polls model | compute_prediction_error |
| Create a map between constrained parameter names and unconstrained parameter indecies | create_constrained_names_to_unconstrained_idx_map |
| Semi-automatic construction of parameters for specific models | create_unpar_one_to_one_map |
| Curate the Swedish polls dataset | curate_swedish_polls |
| What dates are available within the time_line | dates_in_time_line |
| Extract minimal eigen value per iteration | diagnose_extract_min_eigen_value_Omega |
| Extract the percentiles of the divergent transistions | divergent_transitions_percentiles |
| Compute the elpd, percentiles and rmse for a true [known_state] | elpd_known_state elpd_known_state.pop_model8f1 elpd_known_state.pop_model8f2 percentile_known_state rmse_known_state |
| Return parties existing in a given model range | existing_parties |
| Extract parameters from the stan object | extract extract.poll_of_polls |
| Extract refit-ready constructor arguments from a poll_of_polls object | extract_poll_of_polls_input_arguments extract_poll_of_polls_refit_arguments extract_poll_of_polls_sample_arguments |
| Deprecated: extract election periods from a poll_of_polls object | extract_pop_election_period |
| Extract mean x change from a poll_of_polls object | extract_pop_empirical_posterior_mean_x_change |
| Format election period lists to string for printout | format_election_period_to_string |
| Format obs_x lists to string for printout | format_obs_x_to_string |
| Visualize a known state in a poll_of_polls ggplot | geom_known_state |
| Add a [latent_state] geom to a ggplot | geom_latent_state |
| Compute a time period weight tibble | geom_polls_time_weights polls_time_weights polls_time_weights.polls_data polls_time_weights.stan_polls_data polls_time_weights<- polls_time_weights<-.polls_data |
| Visualize a stan_data object | geom_stan_polls_data |
| German election data | german_elections |
| German polls data | german_polls german_polls_curated |
| Get adaptation info | get_adaptation_info |
| The first poll is the poll with the earliest starting date | get_first_poll_as_simplex |
| Return known-state lookback windows for a poll_of_polls object | get_known_state_lookback_windows |
| Return known-state evaluation periods for a poll_of_polls object | get_known_state_periods |
| Return the latest evaluation window for a poll_of_polls object | get_last_evaluation_info |
| Get the latent state for specific dates | get_latent_state_for_dates |
| Get the model diagnostics used in a [poll_of_polls] object | get_model_diagnostics |
| Get the model arguments used in a [poll_of_polls] object | get_model_model_arguments |
| Get the number of draws/samples in a [poll_of_polls] object | get_ndraws ndraws |
| Get the next known state index | get_dates_next_known_state_index get_polls_next_known_state_index get_time_line_next_known_state_index |
| Get the number of time points between known state | get_dates_time_points_between_known_states get_polls_time_points_between_known_states get_time_line_time_points_between_known_states |
| Get the number of time points since the last known state | get_dates_time_points_since_last_known_state get_polls_time_points_since_last_known_state get_time_line_time_points_since_last_known_state |
| Get Sampler Diagnostics | get_sampler_params get_sampler_params.poll_of_polls |
| Extract the date when Stan was run | get_stan_date |
| Get Stan Code from a pop object | get_stancode get_stancode.poll_of_polls |
| Get time line from polls or time range | get_time_line |
| Get the time points for specific dates | get_time_points get_time_points.poll_of_polls get_time_points.time_line |
| Get time points from a time line object | get_time_points_from_time_line get_total_time_points_from_time_line |
| Get the levels/houses from a [poll_of_polls] object | house_levels party_levels |
| Map between houses and house names | house_map |
| What samples are correct? | incorrect_draws |
| Create a latent state object | latent_state latent_state.poll_of_polls latent_state.stanfit |
| Bind latent_state objects | latent_state_abind |
| Apply latent_state objects | latent_state_apply |
| Compute an arbitrary function of latent states | latent_state_FUN latent_state_FUN.latent_state latent_state_FUN.poll_of_polls |
| Compute functions of the latent state | latent_state_draw latent_state_mean latent_state_mean_dates latent_state_percentiles latent_state_sd |
| Subset latent_state objects | latent_state_subset |
| Load a poll_of_polls object saved with save_pop | load_pop |
| Stan Function for pop objects | get_num_pars get_num_upars get_num_upars.default get_num_upars.poll_of_polls log_prob log_prob.default log_prob.poll_of_polls |
| Extract the data when Stan was run | logMeanExp |
| Set default values and assert arguments for a model configuration | model_arguments model_config |
| Return a data.frame with dates from a list of pop objects | model_dates_data_frame |
| Extract the parameter names and parameter counts from a poll_of_polls object | extract_parameter_names get_parameter_names parameters_counts parameter_block_names parameter_names |
| Get parameter names from unconstrained space | parameter_block_names_from_unconstrained_index parameter_names_from_unconstrained_index parameter_unique_names_from_unconstrained_index |
| Parse a data frame of observed x (t distributed) | parse_obs_x |
| A subset of swe_polls stored as a [polls_data] object | pd_test |
| Plot posterior distributions of parameters | pairs.poll_of_polls plot_parameters_areas plot_parameters_mcmc_hex plot_parameters_mcmc_intervals plot_parameters_mcmc_scatter traceplot traceplot.poll_of_polls |
| Plot posterior distributions of parameters | plot_parameters_bayesplot |
| Plot a [poll_of_polls] object | geom_pop_line plot.poll_of_polls plot_poll_of_polls |
| Plot a [polls_data] object | geom_collection_period geom_publish_date plot.polls_data |
| Get and set elements of a [data_polls] object | collection_midpoint_dates end_date end_date<- end_dates end_dates<- houses n n<- poll_id poll_id<- poll_ids poll_ids<- publish_date publish_date<- publish_dates publish_dates<- start_date start_date<- start_dates start_dates<- y y<- |
| Fit a poll of polls object | poll_of_polls |
| Create a [polls_data] object | as.polls_data polls_data [.polls_data |
| Reweights the weights based on function | polls_time_reweight |
| Recompile a poll_of_polls object | recompile_stanfit |
| Refit a poll_of_polls object | reestimate_poll_of_polls refit_poll_of_polls |
| Remove file extension | remove_file_extension |
| function for removing known states outside timeline | remove_known_states |
| Rerun a poll_of_polls object without warm-start reuse | rerun_poll_of_polls |
| Extract more detailed diagnostic information | Rhat_is_above_m Rhat_is_above_m_by_parameter_block Rhat_is_NA Rhat_is_NA_by_parameter_block |
| Sample a dependent variable based on the polls | sample_polls_y |
| Save a poll_of_polls object | save_pop |
| Construct a list of [time_range]s | setup_latent_time_ranges |
| Simulate Polls | simulate_polls |
| Spanish election data | spanish_elections |
| Adds missing data through NA to stan data | stan_data_add_missing |
| Generate Stan Data from [polls_data] objects | stan_polls_data stan_polls_data_model2 stan_polls_data_model3 stan_polls_data_model5 stan_polls_data_model6 stan_polls_data_model6b stan_polls_data_model7 stan_polls_data_model8a stan_polls_data_model8a1 stan_polls_data_model8b stan_polls_data_model8c stan_polls_data_model8d |
| Compute the posterior predictive distribution of polls | stan_polls_data_model stan_polls_data_model.model2 stan_polls_data_model.model3 stan_polls_data_model.model4 stan_polls_data_model.model5 stan_polls_data_model.model6 stan_polls_data_model.model6b stan_polls_data_model.model6c stan_polls_data_model.model7 stan_polls_data_model.model9 |
| Compute standard errors for poll estimates | standard_error |
| stanpop: Package to run Stan for poll of polls models. | stanpop-package stanpop |
| Subset a latent state based on a time range | subset_latent_state_dates subset_time_line_dates |
| Subset a [polls_data] object based on a specific [time_range] | subset_dates subset_publish_dates |
| Subset a [polls_data] object. | subset.polls_data |
| Summarize a polls weight object by a time line | summarize_polls_time_weights |
| Swedish election data | swedish_elections |
| Party time ranges | german_party_time_ranges spanish_party_time_ranges swedish_party_time_ranges |
| Swedish polls data | swedish_polls |
| Spanish polls data | spanish_polls spanish_polls_curated swedish_polls_curated |
| Construct a time_line | time_line time_line.data.frame time_line.numeric |
| Expand a [time_line] object to a new time range but keep the same time point index. | time_line_expand |
| Time range | time_range time_range<- time_range_polls |
| Check if two time ranges are disjoint (not overlapping) | time_ranges_are_disjoint |
| Convert from days to time scale | time_scale_dates |
| Validate backend-specific sampler arguments | validate_backend_sample_arguments |
| Compute the posterior predictive distribution of polls | x_predict x_predict.pop_model6b x_predict.pop_model6c |
| Four true latent states used in experiments | x_test |
| Compute the posterior predictive distribution of polls | poll_predictive_distribution y_predict y_predict.pop_model6b y_predict.pop_model6c |
