predict.tidem {oce} | R Documentation |
Predict a Tidal Signal
Description
This creates a time-series of predicted tides, based on a
tidal model object that was created by as.tidem()
or tidem()
.
Usage
## S3 method for class 'tidem'
predict(object, newdata, ...)
Arguments
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. |
Details
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.
Value
A vector of predictions.
Sample of Usage
# 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)
Author(s)
Dan Kelley
See Also
Other things related to tides:
[[,tidem-method
,
[[<-,tidem-method
,
as.tidem()
,
plot,tidem-method
,
summary,tidem-method
,
tidalCurrent
,
tidedata
,
tidem-class
,
tidemAstron()
,
tidemVuf()
,
tidem
,
webtide()
Examples
# 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)