matteoredaelli / strategico

Automatically exported from code.google.com/p/strategico
GNU General Public License v3.0
1 stars 1 forks source link

Missing historical data when FREQ > 2 #36

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
For instance, you loose half of historical data when switching the FREQ from 2 
to 4

GOOD:

/opt/strategico/strategico.R --cmd eval.ts --project.name web-ltp --id.list 1 
--ts.string 2,22,34,53,54,34,22,66,55,33,55.3,2,22,34,53,54,34,22,66,55,33,55.3 
--ts.start 2001-1 --ts.freq 2

WRONG:

/opt/strategico/strategico.R --cmd eval.ts --project.name web-ltp --id.list 1 
--ts.string 2,22,34,53,54,34,22,66,55,33,55.3,2,22,34,53,54,34,22,66,55,33,55.3 
--ts.start 2001-1 --ts.freq 4

See OUTPUT at
http://rospo.dyndns.org/strategico/projects/web-ltp/0/1/V1/report.html

Original issue reported on code.google.com by matteo.redaelli on 19 Sep 2011 at 6:53

GoogleCodeExporter commented 9 years ago
Livio

it is due to your new functions in strategico_util.R and ltp.R:

Number.ToPeriod <- function(period){  return(c(period%/%2,period%%2+1))  }

Period.ToNumber <- function(period){
  if(is.numeric(period)) 
    return(sum((period-c(0,1))*c(2,1))) 
  else
    return(sapply(period,function(per)   sum((Period.FromString(per)-c(0,1))*c(2,1))))
  }

Please 

-) add the parameter "period.freq" to the new functions
-) rename Number.ToPeriod to Period.FromNumber

Original comment by matteo.redaelli on 25 Sep 2011 at 10:49

GoogleCodeExporter commented 9 years ago
solved with r568 

Original comment by matteo.redaelli on 25 Sep 2011 at 4:48