predict.tidem | R Documentation |
This creates a time-series of predicted tides, based on a
tidal model object that was created by as.tidem()
or tidem()
.
## S3 method for class 'tidem'
predict(object, newdata, ...)
object |
a tidem object. |
newdata |
vector of POSIXt times at which to make the
prediction. For models created with |
... |
optional arguments passed on to children. |
All the tidal constituents that are stored in object
are used,
not just those that are statistically significant or that have amplitude
exceeding any particular value. In this respect, predict.tidem()
follows a pattern established by e.g. predict.lm()
. Note that
the constituents in object
are straightforward if it
was constructed with as.tidem()
, but considerably more complicated
for tidem()
, and so the documentation for the latter ought to
be studied closely, especially with regard to the Rayleigh criterion.
A vector of predictions.
# prediction at specified times data(sealevel) m <- tidem(sealevel) # Check fit over 2 days (interpolating to finer timescale) look <- 1:48 time <- sealevel[["time"]] elevation <- sealevel[["elevation"]] oce.plot.ts(time[look], elevation[look]) # 360s = 10 minute timescale t <- seq(from=time[1], to=time[max(look)], by=360) lines(t, predict(m, newdata=t), col="red") legend("topright", col=c("black","red"), legend=c("data","model"),lwd=1)
Dan Kelley
Other things related to tides:
[[,tidem-method
,
[[<-,tidem-method
,
as.tidem()
,
plot,tidem-method
,
summary,tidem-method
,
tidalCurrent
,
tidedata
,
tidem
,
tidem-class
,
tidemAstron()
,
tidemVuf()
,
webtide()
# Show non-tidal sealevel signal in Halifax Harbour during
# the year 2002. The spike resulted from Hurricane Juan.
library(oce)
data(sealevel)
time <- sealevel[["time"]]
elevation <- sealevel[["elevation"]]
prediction <- tidem(sealevel) |> predict()
oce.plot.ts(time, elevation - prediction)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.