Skip to content

Instantly share code, notes, and snippets.

@nad2000
Created June 9, 2013 02:11
Show Gist options
  • Save nad2000/5737337 to your computer and use it in GitHub Desktop.
Save nad2000/5737337 to your computer and use it in GitHub Desktop.
Relative Error of Bandwidth Estimate Based On Flow Sample
fsvsbs <- read.csv("~/fsvsbs.csv", sep=";")
fsvsbs$rel_err = fsvsbs$rel_err*100
plot(
fsvsbs$rel_err ~ fsvsbs$delta,
xlab="Step / Sub-range Length (sec)",
ylab="Relative Error (%)",
main="Relative Error of Bandwidth Estimate Based On Flow Sample")
nls_fit <- nls(rel_err ~ a + b * delta^(-c), fsvsbs, start = list(a = 43, b = 4, c = 0.2))
lines(fsvsbs$delta, predict(nls_fit), col="red",lwd=3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment