predictRainfall: Predicts the rainfall rate based on a trained model and MSG...

Description Usage Arguments Value Author(s) Examples

Description

Functions calculates predictors which are required by the model and uses them for prediction

Usage

1
2
3
4
predictRainfall(model, inpath = NULL, sceneraster = NULL, rainmask = NULL,
  sunzenith = NULL, date = NULL, useOptimal = TRUE,
  scaleparam = model$scaleParam, min_x = NULL, max_x = NULL,
  type = "tif")

Arguments

model

The final model from either caret's train or rfe. Use model$fit$finalModel or model$finalModel to get it

inpath

Path to the MSG data

sceneraster

If no inpath is specified: The Meteosat data from which rainfall should be predicted. Load them with getChannels

rainmask

A raster indicates areas which are not raining with NA values

sunzenith

If no inpath is specified: sunzenith optional. Only needed if included in the predictor variables

date

If no inpath is specified: date optional. only needed if jday is included in the predictor variables

useOptimal

if model is a rfe object: Logical. Use the optimal variables from rfe or those less variables which lead to a model performance within one sd of the optimal model?

scaleparam

A data.frame created with calcScalingStats

type

If inpath!=NULL then the data type of the MSG raster

Value

A Raster Layer containing predicted rainfall

Author(s)

Hanna Meyer

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# stack the msg scenes:
msg_example <-getChannels(inpath=system.file("extdata/msg",package="Rainfall"))

reference <- raster(system.file("extdata/radar",
"201007121650_radolan_SGrid.rst",package="Rainfall"))
values(reference)[values(reference<0.06)]=NA

data(rfemodel)

#predict on the new scene (don't expect good results from the small model!)
pred<-predictRainfall(model=rfeModel, sceneraster=msg_example, rainmask=reference)
validate(obs=reference,pred=pred)

environmentalinformatics-marburg/Rainfall documentation built on May 16, 2019, 7:49 a.m.