blmod_splines: Blood Model: Splines

View source: R/kinfitr_bloodmodels.R

blmod_splinesR Documentation

Blood Model: Splines

Description

Fits two or three (if both discrete and continuous) splines to blood or AIF data to smooth it

Usage

blmod_splines(
  time,
  activity,
  Method = NULL,
  weights = NULL,
  bs_before = "cr",
  bs_after_c = "cr",
  bs_after_d = "cr",
  k_before = -1,
  k_after_c = -1,
  k_after_d = -1
)

Arguments

time

The time of each measurement in seconds

activity

The radioactivity of each measurement

Method

Optional. The method of collection, i.e. "Discrete" or "Continuous"

weights

Optional. Weights of each measurement.

bs_before

Optional. Defines the basis function for the points before the peak.

bs_after_c

Optional. Defines the basis function for the continuous points after the peak.

bs_after_d

Optional. Defines the basis function for the discrete points after the peak.

k_before

Optional. Defines the dimension of the basis for the points before the peak.

k_after_c

Optional. Defines the dimension of the basis for the continuous points after the peak.

k_after_d

Optional. Defines the dimension of the basis for the discrete points after the peak.

Value

A model fit including all of the individual models of class blood_splines.

Examples

blooddata <- pbr28$blooddata[[1]]
blooddata <- bd_blood_dispcor(blooddata)
blood <- bd_extract(blooddata, output = "Blood")
blood_fit <- blmod_splines(blood$time,
                           blood$activity,
                           Method = blood$Method)

mathesong/kinfitr documentation built on Jan. 15, 2024, 11:07 p.m.