Learn R Programming

pacu (version 0.1.74)

pa_cardinal_dates: Predict cardinal dates from satellite image data

Description

Predict cardinal dates from satellite image data

Usage

pa_cardinal_dates(x, ...)

# S3 method for numeric pa_cardinal_dates( x, y, baseline.months = c(1:3, 12), model = c("none", "card3", "scard3", "agauss", "harmonic"), prior.means, prior.vars, bias.correction, ... )

# S3 method for Date pa_cardinal_dates( x, y, baseline.months = c(1:3, 12), model = c("none", "card3", "scard3", "agauss", "harmonic"), prior.means, prior.vars, bias.correction, ... )

# S3 method for veg.index pa_cardinal_dates( x, y = NULL, baseline.months = c(1:3, 12), model = c("none", "card3", "scard3", "agauss", "harmonic"), prior.means, prior.vars, bias.correction, ... )

Value

when x is a vector, returns a vector of length 3 with the predicted cardinal dates. When x is a veg.index object, returns a stars object with spatially distributed cardinal dates

Arguments

x

vector containing the date or day of the year of that the satellite data was collected

...

ignored

y

vector containing the satellite data value

baseline.months

vector containing the months used as a baseline reference for when there are no crops in the field. For example, c(1:3, 12) represent Jan, Feb, Mar, and Dec.

model

a string naming the model to be used to estimate cardinal dates

prior.means

a vector of length three containing the prior means for cardinal dates

prior.vars

a vector of length three containing the prior variances for cardinal dates

bias.correction

a vector of length three containing the bias correction factor for cardinal dates

Examples

Run this code
if (FALSE) {
x <- seq(1, 365, 6)
y <- nlraa::scard3(x, 120, 210, 300)
pa_cardinal_dates.vector(
  x = x,
  y = y,
  model = 'scard3',
  prior.means = c(130, 190, 297),
  prior.vars = c(11, 13, 18),
  bias.correction = c(10, 10, 10)
)
}

Run the code above in your browser using DataLab