Skip to main content

Questions tagged [kalman]

The [Kalman filter][1], also known as linear quadratic estimation (LQE), is an algorithm that uses a series of measurements observed over time, containing noise (random variations) and other inaccuracies, and produces estimates of unknown variables that tend to be more precise than those based on a single measurement alone. [1]: http://en.wikipedia.org/wiki/Kalman_filter

Filter by
Sorted by
Tagged with
0 votes
1 answer
154 views

Kalman Filter Implementation using PyKalman [closed]

I am trying to apply a simple Kalman filter to pair trading. My underlying stock pair is cointegrated with no constant term. Can someone kindly advise if i am going on the right track with the Kalman ...
pbk's user avatar
  • 3
0 votes
0 answers
49 views

State Space model with heteroskedastic disturbance - approximation of error term

We have a state-space model with a heteroskedastic disturbance term modelled according to some time-varying process (e.g. ARCH, GARCH etc.). The disturbance term is modelled according to e.g. $h_{t+1}=...
Energy Media's user avatar
2 votes
0 answers
91 views

Why long a position when the acutal price is higher than the predicted price? (Kalman filter for pairs trading)

In this paper Elliott, R., van der Hoek, J. and Malcolm, W. (2005) Pairs Trading., the spread (state process) is assumed to follow a mean reverting process $x_{k+1}-x_k=(a-bx_k)\tau+\sigma\sqrt{\tau}\...
Steven Lu's user avatar
  • 121
0 votes
1 answer
122 views

Odd Result from Computing Correlation Matrix from Kalman Filter Posteriori Covariance Estimate

I am using a Kalman Filter to estimate the return dynamics of a forwards curve on a particular commodity. My state space is the initial forwards values, and an initial guess of the drift functions for ...
user85127's user avatar
1 vote
0 answers
114 views

Kalman Filtering theory and application in Finance models under asymmetric or incomplete information

Why do we need Kalman Filtering theory in dynamic models in finance when we consider an environment of asymmetric or incomplete information? I understand that this has to do with the update of the ...
Hunger Learn's user avatar
1 vote
0 answers
214 views

Style analysis and Kalman Filter

I am trying to implement a code that uses Kalman filter to improve the performance of traditional style analysis. I have come across a paper called "Return based style analysis with time varying ...
Davide Martintoni's user avatar
0 votes
1 answer
385 views

Estimating Heston with Unscented Kalman Filter

I am trying to estimate aHeston model using an Unscented Kalman filter. In particular, I am using the following Euler-Murayama discretisation: ...
Puigi's user avatar
  • 1
1 vote
0 answers
86 views

DLM package in R to estimate a state space model with drifts

I am trying to use the DLM package in R to estimate a state space model where the measurement and transition equations are as follows. The measurement equations are: $$ \begin{align} \left( \begin{...
Grillo's user avatar
  • 11
0 votes
0 answers
190 views

How to apply Kalman Filter to GDP data?

Once reverted the Merton/Vasicek formula I could compute the $PD^{PIT}$ for IFRS9 as $PD^{PIT}_i(z) = \Phi \left( \phi^{-1}(PD^{TTC}_i) \sqrt{1-\rho_i} + \sqrt{\rho_i}z\right)$ The main issue is to ...
Nasser Bin's user avatar
0 votes
0 answers
59 views

How to measure the sensitivity of a fund to a set of indices?

I'm trying to understand how recently created funds work and ultimately derive a sort of a probability distribution for their future returns, by approximating them with indices and then using the ...
Tryrshaugh's user avatar
11 votes
2 answers
1k views

Oil price model calibration with Kalman Filter and MLE in python

I am trying to calibrate a one-factor mean-reverting process in python 3. The process is defined as: \begin{equation} dX = k(\alpha - X)dt + \sigma dW , \end{equation} where $\alpha = \mu - \frac{\...
gte's user avatar
  • 143
1 vote
0 answers
151 views

How is it possible that the measurement uncertainty in Kalman Filter is less than 0?

In Euan Sinclair's Option Trading, Pricing and Volatility Strategies and Techniques, it mentions that the true value of the price can be estimated via Kalman Filter: $$S_\mathrm{new} = S + k (S_b − S)...
Doe's user avatar
  • 11
1 vote
0 answers
458 views

Calibration of G2++ two factor interest rate model using Kalman filtering

I'm trying to use the Kalman filter to calibrate a G2++ interest rate model in R. I'm reading "Implementing interest rate models: A practical guide" by Park F.C. (2004) where he provides details on ...
sonarclick's user avatar
1 vote
0 answers
48 views

Likelihood increases on increasing variance of measurement error in kalman filter

I tried to fit a local trend model to daily data of a currency. I used the "dlm" package and tried to estimate the parameters V (measurement noise) and W (the process noise) via maximum likelihood. ...
pppp_prs's user avatar
  • 173
5 votes
0 answers
308 views

Kalman Filter for Multiple Regression?

I'm using Kalman Filter to calculate a rolling spread between two asset price series as commonly described by Chan and many others. I would like to extend this regression to the price of three assets, ...
Pman70's user avatar
  • 51
1 vote
1 answer
162 views

Kalman filter state/measurement noise

In a linear Kalman filter, we assume that the state and measurement noise are white noise N(0,Q) and N(0,R) respectively. Is it common practice to test these hypothesis? And what are the most common ...
ababoua's user avatar
  • 207
3 votes
0 answers
239 views

How can I estimate the time-varying θ term in the Hull-White one factor model?

I am trying to simulate the prices of bond indexes (e.g. Barclays Aggregate, IBOXX sovereign, IBOXX corporates) using Monte Carlo assuming that they follow the SDE given by the Hull-White model (one-...
Enigma's user avatar
  • 31
2 votes
0 answers
72 views

Is my coding for my kalman filter off when testing this specific set of pairs?

My kalman filter seems to be off for this specific set of pairs I'm looking at. As you can see, in the kalman filtered linear regression, there seems to be an outlying blue line nowhere near the data ...
H. Acuna's user avatar
12 votes
1 answer
2k views

Does Chan use the wrong state transition model in his Kalman filter code?

In his book, Algorithmic Trading: Winning Strategies and Their Rationale, Ernie Chan shows how to use a Kalman filter to improve the returns of a cointegrated portfolio. Recall that the state equation ...
Amanda G.'s user avatar
  • 361
1 vote
1 answer
288 views

Have I used correct state space formulation of Bivariate Trending OU process for Kalman Filter estimation?

Introduction I'm trying to estimate the parameters of an Ornstein Uhlenbeck process for a risky asset using the Kalman Filter but have doubts about the state space formulation that I am using. Also, ...
GerardF123's user avatar
2 votes
0 answers
509 views

kalman filter for a multifactor model in R

I am trying to set up a time varying factor model for the purpose of return decomposition via kalman filter. Following this example and slightly modifying it so as to accommodate for more than one ...
sen_saven's user avatar
  • 441
2 votes
3 answers
995 views

Mean and standard deviation of price series with Kalman

I like to calculate the mean and standard deviation of a price series, using the Kalman filter. I am somehow stuck with the deviation, or have some problem in understanding, which my research could ...
Mike's user avatar
  • 41
1 vote
0 answers
276 views

Example Scalar Model Extended Kalman Filter

I have a simple question. I think not a question is, is a request. This month I have been studying how to understand and implement the Kalman filter algorithm for simple models such as the local level....
cassius's user avatar
  • 247
3 votes
1 answer
397 views

kalman filter update equation

Assume that futures price $F(t,T)$ follows the Ito process as described by the following stochastic process $$ln F(t,T)=lnF(0,T)+(Z_1(t)e^{-k(T-t)}+Z_2(t))-(1/4k)[(1-e^{-2kT})(h_1^2+h_2^2))+4h_1h_0(1-...
snowave's user avatar
  • 191
9 votes
3 answers
1k views

Does Kalman filter always improve over linear regression?

If I have a simple linear regression that has statistical signification but I would like to improve the overall prediction results. Will a Kalman filter be always an improvement or as least achieve ...
hotsource's user avatar
  • 439
2 votes
1 answer
467 views

How to find optimal noise covariance matrices Q & R

I am trying to use the discrete Kalman filter for forecasting and I wonder what is commonly considered as the optimal way of determining the measurement noise covariance constants (Q and R) for a ...
Robert Szóstakowski's user avatar
3 votes
0 answers
171 views

Correct form for State Space Equation for Kalman Filter for DNS

In this paper: http://www.ssc.upenn.edu/~fdiebold/papers/paper55/DRAfinal.pdf in eqns 3,5 the state eqn has the mean removed. $(z_t-\mu)=A(z_{t-1}-\mu) + \epsilon_t$ $y_t=C z_t + \delta_t$ ...
Bazman's user avatar
  • 879
2 votes
0 answers
225 views

Identifiability of a state space model (Dynamic Linear Model)

Take a general linear Gaussian state space model (SSM)(aka Dynamic Linear Model DLM): $X_{t+1}=FX_t + V_t$ $Y=HX_t+W_t$ $V_t \sim N(0,Q)$ $W_t \sim N(0,R)$ I am interested in the ...
Bazman's user avatar
  • 879
4 votes
1 answer
2k views

Moving window forecasting in Python

I am looking to create some code that will out-of-sample forecast the HAR-RV model. The model itself is formulated as the following, and the betas are estimated through HAC-OLS or Newey-West. ...
Niklas Lindeke's user avatar
3 votes
2 answers
624 views

Kalman filtering

Is it possible to the extract the latent factor f from the following equations using kalman smoothing? f is the unobserved state value while z is observed series. From the literature i could read ...
user16068's user avatar
2 votes
0 answers
393 views

Time-Varying Copulas (GAUSS)

Could anyone suggest me how to begin with Time-varying Copulas or Stochastic Copulas? I'm looking for the GAUSS code, however it seems there are only MATLAB code available over the internet. I'm ...
Emma's user avatar
  • 21
8 votes
1 answer
10k views

robust open source Kalman filter library in C++

I would like to know if anyone has experience with a good open source kalman filter implementation in C++ that I could use. I require an implementation that supports computation of likelihood similar ...
pavy's user avatar
  • 81
1 vote
0 answers
315 views

Variable Selection with Kalman Filter

I'm trying to estimate factor loadings on portfolios over time for portfolios that are traded pretty frequently. I have a sense that several portfolios are loading on the Fama-French HML factor ...
tragen907's user avatar
  • 151
4 votes
1 answer
269 views

Simulating state space model with AR(1) dynamics

I asked a question similar to this previously: https://dsp.stackexchange.com/questions/16341/simulating-a-state-space-model However I think I have a better handle on it now and want to re-ask it: I ...
Bazman's user avatar
  • 879
4 votes
0 answers
2k views

mean reversion with Kalman Filter - Spread calculation

Ernest Chan in its book "Algorithmic Trading" shows how to use the Kalman Filter for mean reversion pair trading. I have seen that he uses the measurement prediction error for calculating the spread ...
pincopallino's user avatar
2 votes
1 answer
1k views

Maximum Likelihood using a Kalman filter for two factor model

I'm trying to implement a Kalman Filter for the parameter estimation of a linear gaussian two factor model in Matlab. (Schwartz Smith model for commodity prices) In other words: I try to compute the ...
Stephan's user avatar
  • 121
3 votes
0 answers
308 views

Good criteria to sort state-space $\beta_{t}$ according to Kalman filter output

Let's assume the usual state-space linear model without constant term for simplicity: $y_{t}=\beta_{t} X_{t}+\epsilon_{t}$ If we apply Gaussian Kalman filter to estimate $\beta_{t}$ we get $P_{t}$, ...
Lisa Ann's user avatar
  • 2,153
2 votes
0 answers
733 views

Time-varying correlation via state-space representation and Kalman filter

Let a linear time-varying mode like this one: $y_{t}=\alpha_{t}+\beta_{t}x_{t}+\epsilon_{t}$. You can also suppress the constant term to simplify this example: $y_{t}=\beta_{t}x_{t}+\epsilon_{t}$. ...
Lisa Ann's user avatar
  • 2,153
11 votes
3 answers
22k views

How to tune Kalman filter's parameter?

I plan to use Kalman filter to estimate saving account amount. However, I'm a bit lost at how to tune the filter's parameters. Taking as the example from the Wikipedia page, basically there are ...
athos's user avatar
  • 2,231
2 votes
1 answer
3k views

Counterintuitive time varying Beta with Kalman filter

If you're used to play with R, you'll enjoy the following reproducible code: ...
Lisa Ann's user avatar
  • 2,153
18 votes
2 answers
4k views

Parameter estimation of Ornstein–Uhlenbeck and CIR processes

I would like to estimate Ornstein–Uhlenbeck process' parameters via Kalman filter. My process is the following one: $\text{d}x_{t}=\alpha(\theta-x_{t})\text{d}t+\sigma\text{d}W_{t}$ I'm interested ...
Lisa Ann's user avatar
  • 2,153
9 votes
3 answers
24k views

Kalman Filter Equity Example

I am looking out for some material where I can study about Kalman Filter applied to Equity using Excel or R?
Add's user avatar
  • 1,397