sp_fit: Single Parameter Fit

Description Usage Arguments Examples

View source: R/superfit.R

Description

Encodes a numeric vector into a single parameter

Usage

1
sp_fit(data, binary_precision = 12)

Arguments

data

numeric vector

binary_precision

binary precision

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
x <- rnorm(100)
fit <- sp_fit(x, binary_precision = 12)

# Print the single parameter
as.character(fit, digits = 20)

# Plot "observed" and "predicted"
plot(x)
points(predict(fit), col = "red")

# "Extrapolate" to unseen data
plot(predict(fit, length(x) + 10), col = "red")
points(x)

eliocamp/spfit documentation built on Nov. 4, 2019, 11:52 a.m.