getSplineCoefs: Coefficients of a single BayesSpace element.

View source: R/helpers.R

getSplineCoefsR Documentation

Coefficients of a single BayesSpace element.

Description

The coefficients are computed with respect to the given basis. Only a single density data element my be provide, but in many different froms including single case BData* objects, density functions, samples, frequency and density histograms. A density histogram is a histogram structure without counts. Samples need to provide at least minSampleSize elements, to avoid simply misinterpreting inadmissible object types as samples.

Usage

getSplineCoefs(x, ..., basis)

## S3 method for class 'BDataSplines'
getSplineCoefs(x, ..., basis = getBayesSpaceBasis(x))

## S3 method for class ''function''
getSplineCoefs(x, ..., basis = getBayesSpaceBasis(x))

## S3 method for class 'hist'
getSplineCoefs(x, ..., basis = getBayesSpaceBasis(x))

## S3 method for class 'BData'
getSplineCoefs(x, ..., basis = getBayesSpaceBasis(x))

## Default S3 method:
getSplineCoefs(x, ..., minSampleSize = 10, basis = getBayesSpaceBasis(x))

Arguments

x

a single object representing a distribution. A function will be interpreted as density unless.

...

generic arguments supporting the converter. Either minSampleSize or relevant argumens of as.BDataSpline.

basis

the BayesSpaceBasis to be used.

minSampleSize

the minimum length admissible for samples

Value

a numerical vector of coefficients in the given basis

Methods (by class)

  • getSplineCoefs(BDataSplines): the method for BDataSpline objects.

  • getSplineCoefs(`function`): method for density functions. Convert log densities to densities by applying 'Exp()'.

  • getSplineCoefs(hist): method for histograms

  • getSplineCoefs(BData): method for distributions represented as a single element in a BData structure.

  • getSplineCoefs(default): interpreting it as a sample of data. It must have at least 10 observations.

Examples

getSplineCoefs(function(x) x^2,basis=B2Unif01Basis5)
getSplineCoefs(rbeta(1000,2,2),basis=B2Unif01Basis5)


DistributionalDDA documentation built on Oct. 20, 2026, 5:06 p.m.