change_digit: Changes a single digit of a single parameter fit

Description Usage Arguments Examples

View source: R/superfit.R

Description

Changes a single digit of a single parameter fit

Usage

1
2
3
change_digit(fit, which = "random")

sp_difference(original_fit, new_fit)

Arguments

fit, original_fit, new_fit

fit objects returned by [sp_fit()]

which

which decimal digit to change.

Examples

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

# Randomly change the 30th decimal
new_fit <- change_digit(fit, 30)

# visualise the change (numbers in red)
sp_difference(fit, new_fit)

# visualise the impact on "predictions".
plot(x)
points(predict(fit), col = "red")
points(predict(new_fit), col = "blue")

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