[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: Is there a statacommand for a Historical Maximum? & How to cumulate series?
To Whom It May Concern,
Is there a command in stata that gives the historical maximum of a series? (Not the absolute maximum!; i.e. the historical maximum at time T is the maximum of the observations from time t=0 up until t=T. Similarly, the historical maximum at time t=T+1 is the maximum of all the observations from time t=0 up until t=T=1, and so on; the historical maximum thus changes over time, whereas the absolute maximum can only take one value.
My second question is more straightforward; is there a command to cumulate series in Stata (i.e. to calculate the sum of price increases over time)?
P.S. I am trying to write a do-file to run the Gately price-decomposition in Stata. This decomposition decomposes a price-series into a) an initial condition, P1, b) the cumulative series of price decreases, Pdecr, c) the cumulative series of price-increases that have led to an increase in the historical maximum, Pmax d) the cumulative series of price-increases that do not lead to an increase in the historical maximum, Pincr:
* For searches and help try: