-
Notifications
You must be signed in to change notification settings - Fork 6
/
606BD0E
17 lines (17 loc) · 5.79 KB
/
606BD0E
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
"contents" : "% Generated by roxygen2 (4.1.0.9001): do not edit by hand\n% Please edit documentation in R/biasCorrect.R\n\\name{biasCorrect}\n\\alias{biasCorrect}\n\\title{Biascorrect the input timeseries or hyfo dataset}\n\\usage{\nbiasCorrect(frc, hindcast, obs, method = \"delta\", scaleType = \"multi\",\n input = \"TS\", preci = FALSE)\n}\n\\arguments{\n\\item{frc}{a hyfo grid data output or a dataframe (time series) consists of Date column and one or more value columns,\nrepresenting the forecast to be calibrated.}\n\n\\item{hindcast}{a hyfo grid data output or a dataframe(time series) consists of Date column and one or more value columns,\nrepresenting the hindcast data. This data will be used in the calibration of the forecast, so it's better to have the same date period as\nobservation data. Check details for more information.}\n\n\\item{obs}{a hyfo grid data output or a dataframe (time series) consists of Date column and one or more value columns,\nrepresenting the observation data.}\n\n\\item{method}{bias correct method, including 'delta', 'scaling'...}\n\n\\item{scaleType}{only when the method \"scaling\" is chosen, scaleType will be available. Two different types\nof scaling method, 'add' and 'mult', which means additive and multiplicative scaling method. More info check\ndetails.}\n\n\\item{input}{If input is a time series, \\code{input = 'TS'} needs to be assigned, or hyfo will take it as\nan hyfo output grid file. Default is time series input, where in most of the cases we prefer. If your input\nis a hyfo output file, \\code{input = 'hyfo'}.}\n\n\\item{preci}{If the precipitation is biascorrected, then you have to assign \\code{preci = TRUE}. Since for\nprecipitation, some biascorrect methods may not apply to, or some methods are specially for precipitation.\nDefault is FALSE.}\n}\n\\description{\nBiascorrect the input time series or dataset, the input time series or dataset should consist of observation, hindcast, and forecast.\nobservation and hindcast should belong to the same period, in order to calibrate. Then the modified forecast\nwill be returned. If the input is a time series, first column should be date column and rest columns should be\nthe value column. If the input is a hyfo dataset, the dataset should be the result of \\code{loadNcdf}, or a list\nfile with the same format.\n}\n\\details{\nSince climate forecast is based on global condition, when downscaling to different regions, it may include\nsome bias, biascorrection is used then to fix the bias.\n\n\\strong{Hindcast}\n\nIn order to bias correct, we need to pick up some\ndata from the forecast to train with the observation, which is called hindcast in this function. Hindcast\nshould have \\strong{EVERY} attributes that forecast has.\n\nHindcast is also called re-forecast, is the forecast of the past. E.g. you have a forecast from year 2000-2010, assuming now you are in 2005. So from 2000-2005, this period\nis the hindcast period, and 2005-2010, this period is the forecast period.\n\n\n\\strong{How it works}\n\nForecast product has to be calibrated, usually the system is doing forecast in real time. So, e.g., if the\nforecast starts from year 2000, assuming you are in year 2003, then you will have 3 years' hindcast\ndata (year 2000 - 2003), which can be used to calibrate. And your forecast period is (2003-2004)\n\nE.g. you have observation from 2001 - 2002, this is your input obs. Then you can take the same\nperiod (2001-2002) from the forecast, which is the hindcast period. For forecast, you can take any period.\nThe program will evaluate the obs and hindcast, to get the modification of the forecast, and then add the\nmodification to the forecast data.\n\n\\strong{method}\n\nDifferent methods used in the bias correction.\n\n\\strong{delta}\n\nThis method consists on adding to the observations the mean change signal (delta method).\nThis method is applicable to any kind of variable but it is preferable to avoid it for bounded variables\n (e.g. precipitation, wind speed, etc.) because values out of the variable range could be obtained\n (e.g. negative wind speeds...)\n\n \\strong{scaling}\n\nThis method consists on scaling the simulation with the difference (additive) or quotient (multiplicative)\nbetween the observed and simulated means in the train period. The \\code{additive} or \\code{multiplicative}\ncorrection is defined by parameter \\code{scaling.type} (default is \\code{additive}).\nThe additive version is preferably applicable to unbounded variables (e.g. temperature)\nand the multiplicative to variables with a lower bound (e.g. precipitation, because it also preserves the frequency).\n}\n\\examples{\n# Use testdl as an example, we take frc, hindcast and obs fro testdl.\ndata(testdl)\n\n# common period has to be extracted in order to better train the forecast.\n\ndatalist <- extractPeriod(testdl, startDate = '1994-1-1', endDate = '1995-10-1')\n\nfrc <- datalist[[1]]\nhindcast <- datalist[[2]]\nobs <- datalist[[3]]\n\n# default method is delta\nfrc_new <- biasCorrect(frc, hindcast, obs)\n\n# If the variable is precipitation, it cannot be negative value, so use multi scale method\nfrc_new <- biasCorrect(frc, hindcast, obs, method = 'scaling', scaleType = 'multi')\n}\n\\references{\nBias correction methods come from \\code{biasCorrection} from \\code{dowscaleR}\n\nSantander Meteorology Group (2015). downscaleR: Climate data manipulation and statistical downscaling. R\npackage version 0.6-0. https://github.com/SantanderMetGroup/downscaleR/wiki\n}\n\n",
"created" : 1441615447496.000,
"dirty" : false,
"encoding" : "ASCII",
"folds" : "",
"hash" : "1599471990",
"id" : "606BD0E",
"lastKnownWriteTime" : 1441616512,
"path" : "~/hyfo/man/biasCorrect.Rd",
"project_path" : "man/biasCorrect.Rd",
"properties" : {
},
"relative_order" : 6,
"source_on_save" : false,
"type" : "r_doc"
}