lundi 11 septembre 2017

Create simulated Temperature Forecast vector from Actual Temperatures and subject to some constrains

I have a vector of 21885 Hourly Temperatures in Barcelona. I need to simulate that this measures are not actual but forecasted. Meaning that I need to introduce some error in them. I would like to transform these vector to one similar vector but the result should respect the following constraints:

  • Mean Absolute Error [2.5 - 3]
  • 65% of the sample should have Error < 3
  • Max. Error < 6ºC (With low frequency)
  • 10% of the measures should have no error
  • From Instance [i] to instane [i-1] temperature difference should exceed 2. That is: T.i - T.i-1 <= 2
  • The distribution of each 24h should respect the normal temperature distribution within a day as much as possible: from 0h to 7h decreases, then increases to 16h and then decreases again.

To be honest, I do not know where tu start. I have been trying with Solver in Excel but I would like to be able to face the issue from R, language I am learning now.

So I far I will just create a vector of 21885 random coefficientes from -0.15 to 0.15 and multiply my Temperature vetor by (1+randomCoefficente) and work with the new vector but I wonder what would be the smartest way to do it.

The CSV with the ACtual T (Column 1) and the coefficientes (Column 2) and Simulated T (Column ·) is in this link:

http://ift.tt/2vPpkxB

Thank you in any case!!! Any advice will be good recieved.




Aucun commentaire:

Enregistrer un commentaire