## Not run:
# data(resultNest_6p)
# x1 <- resultNest_6p$par
# data(resultNest_4p)
# x2 <- resultNest_4p$par
# temperaturesC <- (200:350)/10
# s <- ChangeSSM(temperatures=temperaturesC, parameters=x1, initial.parameters=x2)
# plotR(list(resultNest_6p, resultNest_4p, s), ylim=c(0,0.3),
# col=list("black", "red", "green"), lty=list(1,1,1),
# legend=list("R function to mimic", "Initial new R function",
# "Fitted new R function"), show.box=FALSE)
# # Other example to fit anchored parameters
# data(resultNest_4p)
# x0 <- resultNest_4p$par
# t <- hist(resultNest_4p, plot=FALSE)
# x <- c(3.4, 3.6, 5.4, 5.6, 7.6, 7.5, 3.2)
# names(x) <- seq(from=range(t$temperatures)[1], to=range(t$temperatures)[2],
# length.out=7)
# newx <- ChangeSSM(temperatures = (200:350)/10, parameters = x0,
# initial.parameters = x,
# control=list(maxit=5000))
# # Example on how to generate a set of SSM parameters from anchored parameters
# xanchor <- GenerateAnchor(nests=resultNest_4p)
# x <- resultNest_4p$par
# xanchor["294"] <- 0
# xanchor["308"] <- 2.3291035
# xprime <- ChangeSSM(parameters = xanchor,
# initial.parameters = x, control=list(maxit=5000))
# plotR(result=resultNest_4p, parameters=list(resultNest_4p$par, xprime$par),
# ylim=c(0,0.3), col=c("black", "red"),
# legend=list("Fitted parameters", "Constrainted parameters"))
# ## End(Not run)
Run the code above in your browser using DataLab