Package 'aaltobda'

Title: Functionality and Data for the Aalto Course on Bayesian Data Analysis
Description: Functionality and Data for the Aalto University Course on Bayesian Data Analysis.
Authors: Aki Vehtari
Maintainer: Aki Vehtari <[email protected]>
License: MIT + file LICENCE
Version: 0.3.2
Built: 2024-11-20 10:26:23 UTC
Source: https://github.com/avehtari/BDA_course_Aalto

Help Index


algae

Description

Algae data set. The data contains the status of algae in 274 measurement sites in Finnish lakes and rivers.

Usage

algae

Format

A vector with 274 elements:

1

Algae present

0

No algae present


bioassay

Description

Bioassay data set. Taken from Table 3.1 in the BDA book

Usage

bioassay

Format

A data frame with 4 rows and 3 variables:

x

dose [log g/ml]

n

number of animals

y

number of deaths


bioassay_posterior

Description

Sample from the posterior of the bioassay model.

Usage

bioassay_posterior

Format

A data frame with 1000 rows and 2 variables:

alpha

Parameter of the bioassay model

beta

Parameter of the bioassay model


Unnormalized log-posterior for bioassay, assuming uniform prior

Description

Unnormalized log-posterior for bioassay, assuming uniform prior

Usage

bioassaylp(alpha, beta, x, y, n)

Arguments

alpha

intercept parameter in the dose-response model (vector or single number)

beta

slope parameter in the dose-response model (vector or single number)

x

vector of doses for each observation

y

vector of number of deaths for each observation

n

vector of number of animals for each observation


Computes the density of a multivariate normal distribution

Description

Computes the density of a multivariate normal distribution

Usage

dmvnorm(x, mean, sigma, log = FALSE)

Arguments

x

vector or matrix of values for which the density is computed. If x is a vector, it represents a single draw. If x is a matrix, each row is taken to be a single draw.

mean

mean vector

sigma

covariance matrix

log

logical indicating whether to return on the log scale or not. False by default.

Value

Densities of the draws x.


drowning

Description

drowning data set. The data contains the number of people who have drowned per year in Finland between 1980 and 2016.

Usage

drowning

Format

A data frame with 37 rows and 2 variables:

year

year

drownings

number of drownings in Finland


factory

Description

factory data set. The data contains quality control measurements from 6 machines in a factory.

Usage

factory

Format

A data frame with 5 rows and 6 variables:

V1

Machine 1

V2

Machine 2

V3

Machine 3

V4

Machine 4

V5

Machine 5

V6

Machine 6


kilpisjarvi

Description

Kilpisjärvi data set. The data contains the Kilpisjärvi summer month temperatures 1952–2013. Kilpisjärvi is in very northern part of Finland. Data by Finnish Meteorological Institute (CC-BY 4.0). Name of the observation station in FMI database is "Enontekiö Kilpisjärvi kyläkeskus"

Usage

kilpisjarvi

Format

A data frame with 62 rows and 5 columns:

year

Year

temp.june

Average temperature in June

temp.july

Average temperature in July

temp.august

Average temperature in August

temp.summer

Average temperature in July–August


kilpisjarvi2022

Description

Kilpisjärvi data set. The data contains the Kilpisjärvi summer month temperatures 1952–2022. Kilpisjärvi is in very northern part of Finland. Data by Finnish Meteorological Institute (CC-BY 4.0). Name of the observation station in FMI database is "Enontekiö Kilpisjärvi kyläkeskus"

Usage

kilpisjarvi2022

Format

A data frame with 71 rows and 5 columns:

year

Year

temp.june

Average temperature in June

temp.july

Average temperature in July

temp.august

Average temperature in August

temp.summer

Average temperature in July–August


Implementation of log(1 / (1 + exp(-x))) robust to over- and under-flow

Description

Implementation of log(1 / (1 + exp(-x))) robust to over- and under-flow

Usage

log_inv_logit(x)

Arguments

x

numeric input


Implementation of log(1 - 1 / (1 + exp(-x))) robust to over- and under-flow

Description

Implementation of log(1 - 1 / (1 + exp(-x))) robust to over- and under-flow

Usage

log1m_inv_logit(x)

Arguments

x

numeric input


Computes MCSE for quantile estimates based on independent draws

Description

Computes MCSE for quantile estimates based on independent draws

Usage

mcse_quantile(draws, prob)

Arguments

draws

Monte Carlo draws

prob

probability for which quantiles is computed


Produces random draws from a multivariate normal distribution

Description

Produces random draws from a multivariate normal distribution

Usage

rmvnorm(n, mean, sigma)

Arguments

n

number of draws

mean

mean vector

sigma

covariance matrix


The Student-t Distribution

Description

Density, distribution function, quantile function and random generation for the Student-t distribution with location/mean mean, scale scale, and degrees of freedom df. See https://en.wikipedia.org/wiki/Location%E2%80%93scale_family for more details on how to get from the standard t-distribution to the t-distribution with additional location and scale parameters.

Usage

dtnew(x, df, mean = 0, scale = 1, log = FALSE)

ptnew(q, df, mean = 0, scale = 1, lower.tail = TRUE, log.p = FALSE)

qtnew(p, df, mean = 0, scale = 1)

rtnew(n, df, mean = 0, scale = 1)

Arguments

x, q

Vector of quantiles.

df

Vector of degrees of freedom.

mean

Vector of location/mean values.

scale

Vector of scale values.

log, log.p

Logical; If TRUE, values are returned on the log scale.

lower.tail

Logical; If TRUE (default), return P(X <= x). Else, return P(X > x) .

p

Vector of probabilities.

n

Number of samples to draw from the distribution.

See Also

TDist


windshieldy1

Description

windshieldy1 data set. The data represents a sample of windshields whose hardness has been measured.

Usage

windshieldy1

Format

A vector with 9 elements


windshieldy2

Description

windshieldy2 data set. The data represents a sample of windshields whose hardness has been measured.

Usage

windshieldy2

Format

A vector with 13 elements