Friday, May 22, 2015

information graphics - How to bind the endpoint of a line to a rectangle/circle in Illustrator?


I am a beginner user of Illustrator and I like it a lot. I also like to make concept maps like this one: enter image description here


I was wondering if there is a possibility to easily create and modify concept maps ?


The problem is that if I draw this diagram in Illustrator:



enter image description here


and then I move the rectangle on the left then the line stays where it is :


enter image description here


What I would like is that the rectangles are associated to the endpoints of the lines so that when I move the left rectangle then the line moves with it like this:


enter image description here


I wonder if accomplishing such a simple task with such a powerful vector drawing application as Illustrator is possible or not ? I would hope it is possible but maybe I just don't know how. Could someone please help me out with this ?



Answer



Let me answer the question itself - i.e. how to move objects together in Illustrator exactly as you ask.


Assume you have this picture, where there are 5 rectangles and 4 direct lines pointing as provided -


enter image description here



You want to move the grey rectangle to any other position in the way where all direct lines move simultaneously with the grey rectangle to the new position.


For this you click on Direct Direction Tool (or press A on keyboard)-


enter image description here


Next, you make a selection rectangle choosing the whole grey rectangle and the points of direct lines that touch the rectangle -


enter image description here


You should see that all points have solid color = are selected, and other points have white feel = not selected - exactly as on the picture.


Now, you locate the pointer above any part of selected objects (usually Ai will note by word "path" when you above some object in question), then you Click and start dragging to any location you want - all the objects will move as you expect them to move (in question I mean) -


enter image description here


or


enter image description here



In a similar way you can move any object as you want: you choose the nearest anchor points and you've done.


arbitrage - Arbitraging OANDA continuous rollover vs other brokers' discrete rollover


Most brokers compute rollover once a day (2200 GMT), but OANDA calculates it continuously.


I thought I'd cleverly found an arbitrage opportunity, but it turns out OANDA knows about this and advertises it. Quoting from http://www.oanda.com/corp/story/innovations



 Professional traders can exploit this flexibility by arbitraging the 
continuous and discrete interest-calculation scenarios through two
trading lines--one with an established player, such as Citibank or
UBS, and the other with OANDA. Whenever they sell a
high-interest-rate currency (such as South African Rand) they can do
so with the traditional player, where they will pay no intra-day
interest for shorting that currency. On the other hand, they can
always buy a high-interest-rate currency through OANDA, where they
earn the "carry" (interest-rate differential) for the position,
however briefly they may hold it.


Has anyone done this? I realize the bid/ask spread on both sides would have to be small, but this still seems viable?


My form of arbitrage is slightly different: hold a high-interest position w/ a regular broker for 1 minute on each side of rollover time, just to get the rollover (for the entire 24 hour period). Take the opposite position w/ OANDA. You'll pay rollover, but for only 2 minutes.


EDIT: Apologies, I never got around to test this. Has anyone else had a chance? I realize oanda.com's higher spreads (which are non-negotiable) may cover the arbitrage.




portfolio management - Michaud's Resampled Efficient Frontier - Out of Sample Simulation Testing


I will be putting ALL my account points on bounty to whoever answers this question [if your answer is crap but it's the only answer, you're getting the 165 points]. You will have to wait 2 days or so from now to receive the points. Yes, all $165$ points!


I purchased Michaud & Michaud's 1998 book called "Effective Asset Management". In it they detail their Resampled Efficient Frontier (REF) methodology. In chapter 6 they present an out of sample simulation test. I'm trying to replicate this test but am having difficulty understanding what they mean because I am not good with a completely wordy explanation of how to do a simulation study. I'll place snippets of their simulation instructions into code and what I think I have to do to replicate the simulation into enumeration/dot-points.


My question is: Have I interpreted their instructions correctly?




In a simulation study, the referee is assumed to know the true set of risk-returns for the assets.


1) I have $\mu$ and $\Omega$, these are considered "true"/population.


The referee does not tell investors the true values but provides a set of Monte Carlo simulated returns consistent with the true risks and returns. In the base case data set, each simulation consists of 18 years of monthly returns and represents a possible out-of-sample realization of the true values of the optimization parameters.



2) I simulate $\mathbf{r}\sim MVN(\mu,\Omega)$, which will be a $T\textrm{x}(\textrm{Number of assets})$ matrix. Here, they are setting the matrix dimensions to be $(18 years*12 months)\textrm{x}(\textrm{Number of assets})$.


Each set of simulated returns results in an estimate (with estimation error) of the optimization parameters and an MV efficient frontier. Each MV efficient frontier and set of estimated optimization parameters defines an RE optimized frontier.


3) This is what I'm most confused about. I'll try to guess at what they're saying here. Here's my guess: Estimate $\hat{\mu}$ and $\hat{\Omega}$ based on the simulated $\mathbf{r}$. Then (i) do MVO optimization over $\hat{\mu}$ and $\hat{\Omega}$, and (ii) Do REF optimization by simulating $500$ futures from $\hat{\mu}$ and $\hat{\Omega}$, resulting in $\hat{\mathbf{r}}_i\sim MVN(\hat{\mu},\hat{\Omega})$,$i \in \{1,...,500\}$. Using $\hat{\mathbf{r}}_i$ to find $\hat{\hat{\mu}}_i$ and $\hat{\hat{\Omega}}_i$, and then find the REF based on these $500$ estimates. This will result in two frontiers, one for (i) and one for (ii).


This process is repeated many times.


4) Repeat steps 2) to 3) $N$ times, at each step storing both the MVO and REF frontier weights matrices that you calculate in 3) (it's a weights matrix because it's a bunch of vectors at each point along the frontier). This will result in $N$ matrices of weights for MVO, where each $n \in \{1,...,N\{$ is the results of one of the simulations 2)$\rightarrow$3). The same for the REF.


In each of the simulations of MV and RE optimized frontiers, the referee uses the true risk-return values to score the actual risks and returns of the optimized portfolios.


5) For each $n \in \{1,...,N\}$, we have weights matrices $_nw_{RE}$ and $_nw_{MV}$. Taking $_nw_{{RE},i}$ as one vector in the matrix of weights $_nw_{RE}$, find $_nw_{{RE},i}' \mu$ and $_nw_{{RE},i}' \Omega_nw_{{RE},i}$ for each $i$. This will result in a graph in $(\sigma,\mathbb{E}r)$ space. Do the same for $_nw_{{MV},i} \forall i \forall n$.


The averaged results of the simulation study are displayed in Exhibit 6.3. The upper dotted curves display the in-sample averaged MV and RE frontiers that were submitted to the referee for scoring. The higher dotted curve is the MV efficient frontier; the lower dotted curve is the REF. The portfolios are plotted based on the simulated risks and returns. However, the referee knows the true risks and returns for each simulated optimized portfolio. The bottom solid curves in Exhibit 6.3 display the average of the true, out-of-sample, risks and returns of the optimized portfolios. The higher solid curve represents the RE optimized results, the lower solid curve the Markowitz optimized results.


]


6) Massive confusion. What are these "average results"? I'm guessing they do the unweighted mean of each of the $(\sigma,\mathbb{E}r)$ results (for all $N$) in step 5) for both methodologies and then plot both frontiers. However what's this OOS/in-sample business? Does steps 1) to 5) result in the OOS frontiers? Is the in-sample frontier the standard REF and MVO calculated from the true $\mu$ and $\Omega$?





Here's an alternative explanation from Michaud and Michaud, in 2008 paper "ESTIMATION ERROR AND PORTFOLIO OPTIMIZATION: A RESAMPLING SOLUTION".


Following Jobson and Korkie (1981) and Michaud (1998, Ch. 6), we perform a simulation test to compare RE vs. MV optimization. In a simulation test, a referee is assumed to know the true values of asset risks and returns. The 20 stock risk-return data, shown in the Appendix, serves as the “truth” in our simulation experiments. The referee creates a simulated history and provides returns that are statistically consistent with the true risk-return estimates. These returns can either be thought of as historical observations of a stationary return distribution, or a number of noisy estimates of next period’s return. The Markowitz and RE investors compute their efficient portfolios based on the referee’s supplied returns. The referee uses the true risk-return values to score the optimized portfolios. Figure 4 gives the average of the results after many simulation tests.


The curves displayed in Figure 4 represent the averaged results from the simulation test. The left-hand panel displays the average MV and RE efficient frontiers computed from the referee’s returns, the portfolios that were submitted to the referee for scoring. The higher (red) dotted curve is the MV efficient frontier; the lower (blue) dotted curve is the REF. The left-hand panel represents what the Markowitz and RE investors see on average given the referee’s data. The right-hand panel of Figure 4 illustrates the average results of how the submitted efficient frontier portfolios performed when the referee applied the true risk-returns. The higher (blue) solid curve represents the RE optimizer results; the lower (red) solid curve the Markowitz optimizer results. The right-hand panel of Figure 4 shows that the RE optimizer, on average, achieves roughly the same return with less risk, or alternatively more return with the same level of risk, relative to the Markowitz optimizer.



Answer



Before answering your questions directly i would like to briefly restate the idea of the resampled efficent frontier:


One of the problem with classical mean variance optimization is (even if the multivariate normal assumption holds) that you cant estimate $\mu$ and $\Omega$ (which is usually denoted as $\Sigma$) exactly. Thats why you incur estimation errors $\hat{\mu}-\mu$ and $\hat{\Omega}-\Omega$ when you deviate from the "population means". This error can change your portfolio dramatically (since MVO is not very robust in general). So the idea is to estimate $\mu$ and $\Omega$ to end up with $\hat{\mu}$ and $\hat{\Omega}$ and sample from the $\text{MVN}(\hat{\mu},\hat{\Omega})$ distribution. From all these samples, calculate the efficient frontier and the optimal portfolio. The RE frontier and RE optimal portfolio will be the mean of those.


This method is a bootstrapping method (where you strangely gain information for adding uncertainty).


Another nice way to think of it is (and here i quote the paper you mentioned): "Every simulated MV efficient frontier [...] is the right way to invest given a set of inputs. But the inputs are highly uncertain. How should an investor deal with portfolio optimality uncertainty?"


And the answer is: One should use the REF to obtain a sub-optimal (for one estimated set of parameters) portfolio which is more prone to estimation error and therefore should result in a better portfolio than from estimation alone. (look at Figure 4 in the paper you mentioned!)



As for your questions, you got everything correct up to step 3.):


3.) I don't know what you mean by futures. I would call them assets. What you should do is you take your values $\hat{\mu}$ and $\hat{\Omega}$ and calculate the RE frontier. To do that you draw lots of samples from $\text{MVN}(\hat{\mu},\hat{\Omega})$, do MV optimization on each of them and compute the mean (both of the optimized pf and the frontiers).


4.) As you said, repeat the steps several times.


5.) You are right here. Just "score" all the portfolios (i think you meant $\Omega$ instead of $\Omega_n$).


6.) The plot shows the average in-sample and out-of-sample efficient frontiers. in-sample: You take all MV efficient frontiers for $\hat{\mu}$ and $\hat{\Omega}$ and build the average. That gives you the "Classical in-sample" curve. Computing the average over the REFs for the same parameters gives you the "REF in-sample" efficient frontiers. In the chart this means that if you consider the average of your sampled parameters as the true population parameter, the MV efficient frontier is always abvoe the resampled efficient frontier. out-of-sample: You take all calculated MV and REF weights but now you calculate the efficient frontier with respect to the true population parameters $\mu$ and $\Omega$. Of course (since they are optimal for another parameter set) this efficient frontiers are lower then their in-sample counterparts. Now comes the important point: The MV efficient frontier is now inferior to the REF. Thats what the whole point of the bootstrapping technique was.


Hope that enlightened you.


Thursday, May 21, 2015

resource recommendations - Where are some good places to find royalty free stock images?



I'm always on the hunt for free stock images to use while I design, what are some good resources for images that are under a a royalty free or creative commons licence?



Answer



http://browse.deviantart.com/photography/


http://www.freeimages.com/


http://www.freeimages.co.uk/


http://www.freedigitalphotos.net


http://www.freefoto.com/


http://www.morguefile.com/


http://www.stockvault.net/


And over thousands of free stock images



http://www.Blogpiks.com/


https://shutterography.com


web - How fast should a website load?


The title almost says it all. How fast should a website load?


Searching this question brings a lot of different stories (most around 2011). Here they say that 50% of the users expect that the site loads under 2 seconds and that users will leave the site if it takes 3 seconds or more. But on other sites they say it should be at most half a second.


What are the current expectations of the users? Are there any (recent) studies on the load time of a page? Or perhaps on the page size?



I know a site should be as fast as possible, are there any numbers (standards / guidelines)?



Answer



Here is some study, it gives detail info.


Infographic
(source: netdna-cdn.com)


novel - Can I be a writer, with a mental illness?


I want to be a writer, but I have struggled with Schizoaffective Disorder for quite some time. Some of the symptoms of the disorder are amotivation and trouble with initiation (Getting things started). I have written many, many incomplete short stories over the past eight years, and my writing is improving... but I want to make this more than just a hobby of mine. I've considered schooling, but I really have to get a handle on my procrastination, or just plain forgetfulness, or lack of motivation, or whatever it is...


Perhaps its due to all the thinking I do instead of writing. I used to think so much, worry, until I could no longer function, and have had to quit jobs because of it. I wasn't very talented at work, whatever work it was, because I would be trapped in my head instead of being on task. I have came leaps and bounds in this regard. I have come to a new beginning, where I am no longer trapped by my own thinking.



I quit drinking, which was a huge distraction from writing, and made my writing worse. I even quit smoking! My life has a normal routine to it now, of psycho-social groups and exercise. My life is heading in a positive direction. I just need something to kick-start my writing.


I want to write a novel


I have the ideas, I'm just afraid that I will give up after I make the outline, like I used to do. At my group they have a room where they allow me to write undisturbed.


My questions are, how much time should I dedicate to writing during the week? (like how many hours each day?) How can I stay motivated, and stick to my goal? Is it possible to write and have a mental illness? How can I stay focused, and not want to write something else even a chapter or two into it? ... and, is writing as a career possible for me?


Thank you.


Jared.



Answer



It is totally possible to become a writer with a mental illness, even Schizoaffective Disorder. I'd suggest that you may have greater self-awareness and coping strategies as a result.


Time Commitment


Whatever works for you. But start with a manageable and reproducible target. Even if it's one hour per day. Start there and grow to suit your situation. If I had to pick an number I'd say aim for 2 hours per day. You can write 50,000 words in a month - that matches NaNoWriMo target and is the length of The Great Gatsby.



Most beginner writers aim for 2 blocks of 2 hours (that they fit in before and after school/work). Interestingly many professional writers I've spoken to also write in blocks of 2 hours. Very few write non-stop for 6-8 hours a day. I suspect that those ones dictate to a transcriber or dictation app. Dictation is a skill I wouldn't recommend learning just yet.


Like playing a musical instrument writing is a skill. You cannot begin writing at 8 hours per day. Instead build up to it based on what works for you. Professional classical musicians practice from 1 to 8 hours per day, but research suggests results diminish after 2 hours.


Mindful writing is required. Actually producing words, not editing - that is a separate effort.


How to stay motivated


Log your work output and effort


Count your daily word output and log it somewhere. On a spreadsheet, in an exercise book, on a whiteboard (take a photo of it from time to time). As you produce words the "run-rate" and total word count will motivate you.


What you write at this stage doesn't matter. 800 words on the outline or plot is still 800 words. Just classify it as outline, plot, Chapter X.


I find it useful to also log the time it took.


You may like to add up to 10 words to describe the session (feelings, thoughts, whatever but keep it brief)


The First Draft is sacred



Writing is about starting. After that writing is about finishing. Finish the draft. It doesn't matter if it is good, you're not going to show that first draft to anyone.


Get the words out. If the writing is ugly or ineloquent, keep going. Trust that you will fix it in the next draft. If you notice a minor plot problem make a note for later (e.g. how does our hero fly this plane if earlier I wrote he has epilepsy and never learned to drive?)


Major plot or character problems may require you to retrace your steps by going back and changing things. I would suggest making a note about the problem and proceeding if possible as if you'd fixed it earlier.


The goal is to finish the draft. It is like climbing Everest. Once you are in the danger zone you have 2 options - reach the summit or return to base camp.


Don't judge your work until you finish this draft


Our inner editor/reader/critic is the main reason most people do not write more or finish much.


Separate Editing from Writing


Don't edit while you are writing and don't write while you are editing.


After you write X words or Y minutes/hours take a short break before reviewing the words. Ideally don't revise the work until you have the first draft completed. If you must review I suggest reviewing the previous day's work or even the work from last week.


Avoid the trap to you tweak as you write.



After you finish your first story (short- or novel), start the next one immediately during your next writing session. Edit the first story in your editing session. So if you write for 2x2hrs each day you can either make the second 2hr block an editing session or you can fit a third 2hr editing session in. See how you feel.


Keep reminding yourself that you will fix the writing and plot problems in the next draft.


Plan your writing


Create an outline - it may or may not be "canon" for your story. I find my characters go off on their own.


Break the project down to chunks. You don't need to plan those chunks down to daily goals. They should be specific and they should be achievable in a week.


Every writing session has an outcome. It can be either a word count or a story point. Tell yourself what part of the story you are telling this session.


It's okay to start with short stories and grow from there.


If you get distracted after a chapter or two spend some time writing short stories that are finished in one writing session. Then work on longer short stories that take a few sessions to finish.


Build up to stories that take a week to finish.


Finally you'll be ready to move to stories that take a month to a year to finish a draft.



Practice your editing process on the short stories if you like.


Have a Workspace


I write on my laptop in a variety of places but I have a special place that I churn out words.


The familiarity reinforces your brain that this is writing space and time.


Put a written goal visible at every writing session.


Use either a post-it note or a big sign above your screen, but put up that goal.


Today I will write "The hero arrives at the camp"


Time



  • Write at the same time every day.


  • Write for the same amount of time. This is beginning advice, some professional writers keep writing until they get their word count every day. Journalists do this too.

  • Start writing at the beginning of the writing session. No Tea or Coffee making, outline reviewing, twitter/email/stackexchange checking. 9:00am start producing words.


Maintain a Sparks file



A file (or collection of files) to collect ideas (i.e. Sparks). Periodically review to refocus and generate new tasks. -- Fritz Freiheit on Sparks



This helps with motivation but is really about writing process.


I have a text file in my writing directory called _Sparks.txt (so it sorts to the top). I have it open in my editor but minimised.


If I get a great idea while writing my current goal, I quickly type the pertinent points out in the Sparks file and save it for later. If later I can't tell what was so fascinating about the idea then it was just a distraction. Normally I still like the idea when I return to it.



My sparks range from single lines e.g. * I am a minor league mansplainer to 500 words of plot or setup or even a picture I found online (I save picture inspiration to pinterest.com)


I count words I add to the spark file in a separate column on my daily log.


When I want to start a new project I open the Sparks file and pick a project. I create the folder for the project in my writing directory, I cut the spark note out and put it in the project directory, along with other inspiration and log files.



I print out my first draft double spaced with 1" margins.


I edit with a pen and hand write the changes.


My second draft is then written by retyping the entire thing incorporating my notes and changes - no cutting and pasting. That is the second draft.


Rinse and repeat.


Nobody ever gets to see my first draft or any draft I haven't finished because...




The First Draft is Sacred!



usability - Is it acceptable practice to use checkboxes as radio buttons?


Can someone point me in the direction to articles regarding checkboxes and radio buttons?



I'm in a discussion with an Art Director and he is convinced it makes more sense to use checkboxes because radio buttons look uglier.


Here's the scenario, there are 2-4 steps:


User is presented with step 1 where the user may choose a single option out of 6.


Based on the selection made in step 1, the user will be either presented with a final question that is multi option. Or they will be presented an additional step where the user may only choose a single option.


The AD is convinced that all the fields may be checkboxes. I personally believe all the options where only a single option may be chosen should be radio buttons.


Is there a right or wrong in this scenario?



Answer



Answer: No.


Checkboxes vs. Radio Buttons - Nielsen Norman 2004




Radio buttons are used when there is a list of two or more options that are mutually exclusive and the user must select exactly one choice. In other words, clicking a non-selected radio button will deselect whatever other button was previously selected in the list.


Checkboxes are used when there are lists of options and the user may select any number of choices, including zero, one, or several. In other words, each checkbox is independent of all other checkboxes in the list, so checking one box doesn't uncheck the others.



technique - How credible is wikipedia?

I understand that this question relates more to wikipedia than it does writing but... If I was going to use wikipedia for a source for a res...