simulation_conformal_scores_mix_reg: calculate some conformal scores related to simulation based...

Description Usage Arguments Value

View source: R/flexmix_poor_fit_Y.R

Description

#' this wrapper assumes a model has been fit relative to the 2 mode mixture of linear regression (similar to flexmix) for the underlying mass non-conformal mass scores

Usage

1
2
3
4
5
6
7
8
simulation_conformal_scores_mix_reg(
  x,
  y,
  model_params,
  sim_num = 100,
  h = 0.4,
  grid = seq(-15, 15, by = 0.01)
)

Arguments

x

true x

y

true y

model_params

list of model parameters of with names as follows

  • beta: a vector, length 2

  • intercept: a vector, length 2

  • sd: a vector, length 2

  • proportions: a vector, length 2

that represent a conditional distribution defined by

y ~ p1 M1(x) + p2 M2(x)

where (M1,M2)(x) ~ right_intercept + N(right_beta*x, right_sd) and (p1,p2) = right_proportions

sim_num

number of simulations to base the kernel density estimate of the cde

h

kernel density estimate bandwidth parameter

grid

discretizes grid that y should range over (needs to be equally spaced)

Value

a data.frame with 3 columns (and 1 row)


benjaminleroy/simulationBands documentation built on Dec. 19, 2021, 8:41 a.m.