# Signal() Formula

## Recommended Posts

Hello,

I'm trying to use the signal() formula to create a signal that increases by 2 F  temp. per day for one year. For some reason, when I build the

\$newsignal = signal(Interpolation.Linear, 365d, sample(now(),100), sample(now()+365d, 100+2*365))

\$signal.ForecastSplice(\$newsignal) , it only interpolates and shows values for the next 60-70 days. Is there a reason why I can build a longer trend and splice it with an existing signal ?

Thanks

##### Share on other sites

Hi Ali,

as a workaound try this one:

\$signal.splice(\$newsignal, condition(1y, capsule(now(), now()+1y)))

Regards,

Thorsten

##### Share on other sites

Hello Ali,

If I understand your question correctly you want to splice a signal that increase 2°F per to the end of some temperature signal such that the newly spliced signal starts at the last known value of your temperature signal.

1. The following syntax in the formula tool will create a signal that increases 2°F per day starting at now.

(timeSince(toTime(now()), 1d)*2).setUnits('F')

2. Then to splice them I suggest following syntax.

\$signal.forecastConstant(365d) + \$IncreasingTemp

The final result:

Hope this helps,

Teddy

##### Share on other sites

Thank you Thorsten & Teddy.

Teddy,

I used both of the formulas you mentioned but for some reason I only getting the future time signal.

I used:       (timesince(toTime(now()),1d)*2).setUnits('F')     for green line

And            \$Temp.forecastConstant(365d)+\$f10                   for orange line {\$f10 is the green line}

Thanks

##### Share on other sites

• Seeq Team

Hi Ali

There is one last step to combine them into one signal. That is using our Forecast Splice Function as seen below.

You can do this in a separate formula as seen above or combined or by updating your original formula as seen below.

##### Share on other sites

Hi Morgan,

I think the initial problem is that forecastSplice() seems to combine the value from the original signal and the forecast only for the next 90 (?) days and then stops combining them.

Regards,

Thorsten

##### Share on other sites

Ali,

To combine them into one signal you can use the following syntax in the forecast formula from step 2.

\$signal.forecastConstant(365d) + 0.toSignal().splice(\$IncreasingTemp,\$IncreasingTemp.isValid())

Screen shot for details:

Note: This will result in a completely uncertain(dashed) signal. This is because of it's dependence on now() in the first formula.

Hope this helps,

Teddy