Community RSS Feed
https://community.wolfram.com
RSS Feed for Wolfram Community showing any discussions in tag Economics sorted by activeBest Way to Find and Replace Adjacent Elements in a List?
https://community.wolfram.com/groups/-/m/t/1593367
Hi everyone,
I have a function that returns a list with a series of boolean value False followed by a series of boolean value True like this:
{False, False, False, True, True, True, True, True}
The False's always come before the True's, and the number of False's does not have to equal the number of True's. I need to replace the last False in the series—the third one in my example—with True. This works
Flatten[ReplaceAll[
Split[{False, False, False, True, True, True, True,
True}, #1 =!= #2 &], {False, True} -> {True, True}]]
but it seems like there should be a simpler or more elegant way. Any thoughts?
GregGregory Lypny2019-01-16T20:27:08ZSpecify a function for Expectation: Specifically AR(2) Time Series?
https://community.wolfram.com/groups/-/m/t/1589354
I'm new to Mathematica so having some issues with functional specifications. Basic help will suffice even if it's not specific to my problem below.
I'm trying to take the expectation of a product of functions and definitely doing it incorrectly. For instance how would I recreate variance such as:
$$ \sigma^2= \mathrm { E } [ X ^ { 2 }] - \mathrm { E } [ X ] ^ { 2 }$$
I'm dealing with a WhiteNoiseProcess with constant variance. I got something relevant with:
> In[1]= Expectation[ $ y[t] * y[t] $, y \[Distributed] WhiteNoiseProcess \[ $\sigma$ ]]
> Out[1]= $\sigma^2$
Any help with how to properly input functions would be helpful. But if specifically how to take expectations of their products that'd be great.
---
My specific problem of interest involves Yule-Walker case:
The objective function is $$ y _ { t } = a _ { 1 } y _ { t - 1 } + a _ { 2 } y _ { t - 2 } + \varepsilon _ { t }$$
The assumptions for this AR(2) time series function is the error is white noise with a mean of 0, and constant variance equal to $ \sigma^2 $. The series $ y_t $ is stationary with a constant mean $ \mu $ and variance equal to $ \sigma^2 $. Both of are time invariant.
$$E y _ { t } y _ { t } = a _ { 1 } E y _ { t - 1 } y _ { t } + a _ { 2 } E y _ { t - 2 } y _ { t } + E \varepsilon _ { t } y _ { t }$$
So by Yule-Walker steps I'm trying to multiply this difference equation by $ y_t $ then take its expectation.
The only other relevant output I got more specific to my problem is the following:
In[12]:= Expectation[a[1]* y[t-1] *y[t] + a[2] * y[t-2]*y[t] + \[Epsilon][t]*y[t] , {y \[Distributed] NormalDistribution[\[Mu],\[Sigma]], \[Epsilon] \[Distributed] WhiteNoiseProcess [\[Sigma]]}]
Out[12]= a[2] y[-2+t] y[t]+a[1] y[-1+t] y[t]
Any help is appreciated.A.I. S2019-01-14T00:53:04ZUse extra indicators in financial charts?
https://community.wolfram.com/groups/-/m/t/1588019
1) How can I get the list of values of some financial indicator used in *InteractiveTradingChart*, calculate some function of it ((for example, the square) and include it in InteractiveTradingChart as an extra indicator?
2) Is it possible in *FinancialData* to get the data for shorter periods than Daily?Victor Mitin2019-01-11T18:20:49Z