[R-SIG-Finance] [R-sig-finance] determine non-linear correlation
manulemalin
junkmanu at free.fr
Sat Jun 6 15:21:44 CEST 2009
things are not that easy
in your example, your data are non stationnary
( it should be clearer if you have a look at the unit roots of your model(s)
)
as already said, having a look at cointegration can be a good start
moreover, ( as already said!), there is not ONE function to determine
nonlinearity; it's up to you to determine, and test, the kind of your
nonlinearities
if you have got no idea / your nonlinearities, you can use nonparametric
modelling, which can work, for instance with neural networks, as a black box
( which can also be misleading...)
hope it helps
regards
manu
Mark Breman-2 wrote:
>
> Here is the thesis I was talking about:
> www.jos.org.cn/ch/reader/download_pdf.aspx?file_no=20001203&year_id=2000&quarter_id=12&falg=1
>
> I did some experiments based on the replies to my post which pointed me in
> the right direction (thank you for that):
>
> let's say I have a timeseries a:
>
>
>> a
> priceA
> 2009-06-01 1
> 2009-06-02 2
> 2009-06-03 3
> 2009-06-04 4
>
> And a timesieries b:
>
>> b
> priceB
> 2009-06-01 11
> 2009-06-02 12
> 2009-06-03 13
> 2009-06-04 14
>
> priceB is derived from priceA by the simple linear function priceB = 10 +
> priceA.
> As expected all correlation methods agree that timeseries B is highly
> correlated to A:
>
>> cor(a,b, method="pearson")
> priceB
> priceA 1
>> cor(a,b, method="kendall")
> priceB
> priceA 1
>> cor(a,b, method="spearman")
> priceB
> priceA 1
>
> Now suppose I have another timeseries F:
>
>> f
> priceF
> 2009-06-01 9
> 2009-06-02 24
> 2009-06-03 45
> 2009-06-04 72
>
> priceF is derived from priceA by the nonlinear function: 3*(priceA^2) +
> 6*priceA.
> If I'm correct than this is known a "second order kwadratic function"
> which is not a linear function. (If you would draw it in a graph it would
> be shown as a parabolic line)
>
> Now let's look at the different correlation methods for timeseries A and
> F:
>
>> cor(a,f, method="pearson")
> priceF
> priceA 0.9919354
>> cor(a,f, method="kendall")
> priceF
> priceA 1
>> cor(a,f, method="spearman")
> priceF
> priceA 1
>
> Note that Pearson obviously does not know about the nonlinear function
> between priceA and priceF as it does not reports a correlation of 1.
> Kendall and Spearman on the other hand seem to know about the nonlinear
> function as they report a correlation of 1 between A and F.
> So my conclusion (correct me if I am wrong): kendall and spearman can
> handle nonlinear functions as the basis for the corellation, pearson can
> not. (one of you already pointed this out in a reply I think)
>
> I'm still left with one questions thought:
> Is it possible (with R) to obtain the function that forms the basis for
> the correlation as reported by kendall and spearman? I mean: if I have two
> real timeseries which are highly correlated according to kendall and
> spearman (i.e. cor(x,y) = 1) I would like to know the (nonlinear) function
> that form the basis for the correlation.
>
> Regards,
>
> -Mark-
>
>
>
>
>
>
> ________________________________
>
>
> Sent: Friday, June 5, 2009 1:18:55 PM
> Subject: Re: [R-SIG-Finance] determine non-linear correlation
>
>
> correlation by definition is a linear measure of assocation. So what is
> the presice definition of non-linear correlation?
> can you give the thesis......I am curious to know....
> Kaushik Bhattacharjee
>
>
>
>
> ________________________________
>
> To: r-sig-finance at stat.math.ethz.ch
> Sent: Thursday, June 4, 2009 12:45:17 AM
> Subject: [R-SIG-Finance] determine non-linear correlation
>
> I would like to know if two financial time-series are nonlinear
> correlated, and if so, what that correlation function is.
> Is there an easy way to do this with R?
>
> I have read a thesis about the "high order correlation coefficient to
> solve the nonlinear correlation problem" but I'm not able to translate
> this into a solution for my problem. All these statistics are very
> interesting but also challenging for me...
>
> Kind regards,
>
> -Mark-
>
>
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only.
> -- If you want to post, subscribe first.
>
>
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only.
> -- If you want to post, subscribe first.
>
>
--
View this message in context: http://www.nabble.com/determine-non-linear-correlation-tp23857603p23901855.html
Sent from the Rmetrics mailing list archive at Nabble.com.
More information about the R-SIG-Finance
mailing list