Lags & changes

SupportCommunity General Lags & changes

Ansicht von 6 Beiträgen - 1 bis 6 (von insgesamt 6)
  • Autor
    Beiträge
  • #12633
    Tathagata GhoseTathagata Ghose
    Mitglied

    Hello,

    Sorry to ask for basic info, but I couldn’t find this in the manual or help (I obviously didn’t use the correct terminology to search).

    How does one refer to a time index or subscript of a signal in a rolling manner? By rolling, I mean that it is not enough that I can get the signal value at a certain fixed date (e.g. 1 Jan 1980).

    My use of Flexpro is non-engineering related – it is in plotting economic data, mostly monthly.

    1. E.g. if I need to plot a data series lagged 6-months, how would I do this? In other statistical programs, I would simply use
    series (t-6). How would I write this in Flexpro?

    2. I often need to calculate the % change of the data over the value from the same month a year ago [i.e. series (t)/series(t-12)]. How would I write this in Flexpro?

    Once again, all I need to know is how to refer to the time subscript in a rolling manner. I can do the rest.

    Thanks in advance
    Tatha

    #8296
    Tathagata GhoseTathagata Ghose
    Mitglied

    Hello,

    Sorry to ask for basic info, but I couldn’t find this in the manual or help (I obviously didn’t use the correct terminology to search).

    How does one refer to a time index or subscript of a signal in a rolling manner? By rolling, I mean that it is not enough that I can get the signal value at a certain fixed date (e.g. 1 Jan 1980).

    My use of Flexpro is non-engineering related – it is in plotting economic data, mostly monthly.

    1. E.g. if I need to plot a data series lagged 6-months, how would I do this? In other statistical programs, I would simply use
    series (t-6). How would I write this in Flexpro?

    2. I often need to calculate the % change of the data over the value from the same month a year ago [i.e. series (t)/series(t-12)]. How would I write this in Flexpro?

    Once again, all I need to know is how to refer to the time subscript in a rolling manner. I can do the rest.

    Thanks in advance
    Tatha

    #9023
    Bernhard KantzBernhard Kantz
    Moderator

    For this you can create a FPScript formula and use the Index Operator [] or the Value Index Operator [[]].
    You can also copy a signal range in a diagram to a FPScript formula. Using the Copy Range command on the toolbar or in the Cursors menu, you can copy the section of the curve between the cursors to the clipboard. The command saves a formula in the clipboard, which extracts the section from the curve. When you run the command, a dialog box appears where you can specify whether the current cursor positions should be inserted as fixed values or as variable values.

    See also
    Index Operator (FPScript)
    Value Index Operator (FPScript)
    Copying Signal Sections to the Clipboard

    support@weisang.com

    #9024
    Tathagata GhoseTathagata Ghose
    Mitglied

    Hello,

    Thanks for your reply. I’m still having problems translating the material from the help/manuals for my specific use.

    E.g. you talk about extracting data and index operators. It is not yet clear to me how to use these to lag a data series. I don’t need to extract any values or change any values. What I need is that the values of the data series will appear against changed values of “time”. Let’s say, I lag a series by 6 months. Then, the data value that was originally against say, January 1980, will have to appear against July 1980.

    How do I create this shift in the data? Also, I cannot do it month-by-month using a fixed index which references specific dates. It has to be an automatic method which updates as new data arrive.

    I kind of get the idea that the ValueIndex operator will eventually get me there, but I’m not finding many examples where the index is used in a variable manner. Using a fixed index, I can easily extract from a data series, say, “the 60th value”, but how do I write “for every ‘time = t’, extract the ‘t-6’th value from the data series and put it against ‘t’ in a new data series”?

    I just need one more concrete example, I think.

    Thanks
    Tatha

    #9025
    Bernhard KantzBernhard Kantz
    Moderator

    Example:
    A signal consists of one value per month.

    
    Dim n = NumberOfRows(Signal)
    Dim idx1 = (n-6, 6, 1)
    Dim idx2 = (n-6, 0, 1)
    Signal[idx1] / Signal[idx2]
    

    The result is the ratio of the i-th and ‘i-6’th value.

    support@weisang.com

    #9026
    Tathagata GhoseTathagata Ghose
    Mitglied

    Sorry, pl ignore my other mail that I just posted. You are, indeed, using the sequence series as [Index] for to extract signal values. I think if I work with that framework, I will get the results I am looking for.

    Thanks
    Tatha

Ansicht von 6 Beiträgen - 1 bis 6 (von insgesamt 6)
  • Du musst angemeldet sein, um auf dieses Thema antworten zu können.