OutcomeModel {mpower}R Documentation

Outcome generator

Description

This function creates a generative model of the outcome given a matrix of predictors.

Usage

OutcomeModel(f, family = "gaussian", sigma = 1, f_args = list())

Arguments

f

A string that describes the relationships between the predictors and outcome or a function that takes an input matrix and returns a vector of outcome: E(y|x) = g(f(x)) where g is a link function that depends on the family argument.

family

A string, 'gaussian', 'binomial', or 'poisson' for continuous, binary, or count outcomes.

sigma

A number, Gaussian noise standard deviation if applicable.

f_args

A named list of additional arguments to f

Value

An OutcomeModel object. Attributes:

f

mean function.

sigma

a number for the Gaussian observation noise.

family

a string 'gaussian' or 'binomial'.

Examples

# Define BMI as a ratio of weight and height plus random Gaussian error with standard deviation 1.
bmi_model <- mpower::OutcomeModel(f = 'weight/(height^2)', sigma = 1, family = 'gaussian')

[Package mpower version 0.1.0 Index]