[R-SIG-Finance] R-SIG-Finance Digest, Vol 60, Issue 9
dmhutch at gmail.com
dmhutch at gmail.com
Sat May 9 21:18:13 CEST 2009
Dee
Sent from my BlackBerry device on the Rogers Wireless Network
-----Original Message-----
From: r-sig-finance-request at stat.math.ethz.ch
Date: Sat, 09 May 2009 12:00:01
To: <r-sig-finance at stat.math.ethz.ch>
Subject: R-SIG-Finance Digest, Vol 60, Issue 9
Send R-SIG-Finance mailing list submissions to
r-sig-finance at stat.math.ethz.ch
To subscribe or unsubscribe via the World Wide Web, visit
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
or, via email, send a message with subject or body 'help' to
r-sig-finance-request at stat.math.ethz.ch
You can reach the person managing the list at
r-sig-finance-owner at stat.math.ethz.ch
When replying, please edit your Subject line so it is more specific
than "Re: Contents of R-SIG-Finance digest..."
Today's Topics:
1. maxratioPortfolio (Michael Schulman)
2. Quantmod getFinancials (Francisco Javier Perez Caballero)
3. Re: Quantmod getFinancials (Joshua Ulrich)
----------------------------------------------------------------------
Message: 1
Date: Fri, 8 May 2009 15:48:36 +0000
From: Michael Schulman <mschulman at lightboxcap.com>
Subject: [R-SIG-Finance] maxratioPortfolio
To: "R-SIG-Finance at stat.math.ethz.ch"
<R-SIG-Finance at stat.math.ethz.ch>
Message-ID:
<E8AAF3671DF8FD48B55D9CC7A88B9516783B63F324 at MBX4.EXCHPROD.USA.NET>
Content-Type: text/plain
Hi,
First wanted to thank everyone for a lot of very good hard work done on R and the subsequent packages.
So I've been looking at the maxratioPortfolio code in fPortfolio. One thing I notice is how the range is decided for the search. It looks like the range is decided by passing "interval = range(getMu(Data))" While this works well in a completely unrestrained situation it does not work when there are constraints. To give an example. I am trying to optimize a portfolio with 3 assets with the following constraints :
c("minW[1:nAssets] = -0.5", "maxW[1:nAssets] = 0.5", "eqsumW[1:nAssets] = 1e-7", "Partial")
In other words I want a dollar neutral portfolio with no weight greater or less than .5, -.5 respectively. As a side note having to pass in 1e-7 is somewhat counterintuitive but I could not find another way as passing in 0, removed that constraint.
My mu and sigma are :
$mu
S VZ T
0.007075173 -0.001899547 -0.001357274
$Sigma
S VZ T
S 0.008534089 0.0015257184 0.0015642080
VZ 0.001525718 0.0009147493 0.0008163796
T 0.001564208 0.0008163796 0.0009165100
Now just taking the min and max of my mu as the range is wrong. They are not feasible portfolios as I can not allocate 100% to that. In general in other optimizers I've seen the range is decided by solving for the max return given the constraints and no constraint on the variance. Its usually a simple linear programming problem.
In my case the weights would be 0.5, -0.5, 0 to get me the maximum returns within my portfolio and within my constraints.
Sorry if anything above is incorrect, out of context, or just stupid. I'm fairly new to R so I have no doubt I'm mistaken on many things.
Thanks... mike
DISCLAIMER: The information contained herein is to be co...{{dropped:13}}
------------------------------
Message: 2
Date: Fri, 8 May 2009 14:28:28 -0400
From: Francisco Javier Perez Caballero <fjpcaballero at gmail.com>
Subject: [R-SIG-Finance] Quantmod getFinancials
To: <r-sig-finance at stat.math.ethz.ch>
Message-ID: <4a0479d0.09b6660a.53b9.ffffa8e3 at mx.google.com>
Content-Type: text/plain
I'm getting the following error (R 2.9.0, quantmod 0.3-7, Revision 461):
> AAPL <- getFinancials('AAPL')
Error in colnamesISCF[[2]] : subscript out of bounds
Any idea of what may be going on?
[[alternative HTML version deleted]]
------------------------------
Message: 3
Date: Fri, 8 May 2009 15:49:16 -0500
From: Joshua Ulrich <josh.m.ulrich at gmail.com>
Subject: Re: [R-SIG-Finance] Quantmod getFinancials
To: Francisco Javier Perez Caballero <fjpcaballero at gmail.com>
Cc: r-sig-finance at stat.math.ethz.ch
Message-ID:
<8cca69990905081349g472e6075la629a443b606cec0 at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
Google must have changed their pages again.
The function tries to grep for "Ending" in the HTML, but the word is
no longer in initial caps. I have patched the r-forge version of
quantmod. You can either download it, or change "Ending" to "ending"
in your source and rebuild.
HTH,
Josh
--
http://www.fosstrading.com
On Fri, May 8, 2009 at 1:28 PM, Francisco Javier Perez Caballero
<fjpcaballero at gmail.com> wrote:
> I'm getting the following error (R 2.9.0, quantmod 0.3-7, Revision 461):
>
>> AAPL <- getFinancials('AAPL')
> Error in colnamesISCF[[2]] : subscript out of bounds
>
> Any idea of what may be going on?
>
>
> ? ? ? ?[[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.
>
------------------------------
_______________________________________________
R-SIG-Finance mailing list
R-SIG-Finance at stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
End of R-SIG-Finance Digest, Vol 60, Issue 9
********************************************
More information about the R-SIG-Finance
mailing list