Monday, December 31, 2018

portfolio management - Rockafellar-Uryasev mean-CVaR optimiztion


In Rockafellar-Uryasev 2001 paper the mean-CVaR optimization can be written as a linear programming optimization problem as:


$$P_{\text{CVaR}} = \arg \min_w \text{VaR}_\alpha+\frac{1}{(1-\beta)S}\sum_{s=1}^{S}y_s $$ subject to: $$y_s \geq f(\mathbf{w},\mathbf{r_s})-\text{VaR}_\alpha$$ $$y_s\geq 0$$ where $$y_s = [f(\mathbf{w},\mathbf{r_s})-\text{VaR}_\alpha]^+$$ I have 2 questions regarding this optimization:



  1. How is the VaR computed? or while programming the optimization the user has to program the way the VaR is going to be computed. Here (http://past.rinfinance.com/agenda/2009/yollin_slides.pdf) is an R code to do the optimization but I don't see anywhere VaR computation.

  2. Isn't the first restriction obvious? given the definition of $y_s$ or my understanding of $y_s$ is incorrect?



Answer




  1. $VaR_\alpha$ is a scalar choice variable in the minimization problem. In the Rockafeller-Uryasev paper, it is simply called $\alpha\in R$. (C.f., the program described in Theorem 2 of that paper, or the programming problem described after equation (17); alternatively, look at the structure of the choice vector $x$ on page 16 of the Yollin slides.) $VaR_\alpha$ is thus a by-product of solving the problem.


  2. The fact that $y_{s}=[f(w,rs)−VaR_\alpha]^{+}$ is also a by-product of solving the problem; it is not imposed. Rather, the $y$ vector is an auxiliary choice variable. (Your $y$ plays the role of $d$ in the Yollin slides, which are embedded in the choice vector $x$ on page 16.) The constraints impose the equality implicitly. But if that equality were imposed directly in the program, the constraint set would fail to be convex (the problem would not be a linear programming one), and the solution would be greatly complicated.


print design - How To Ask Fellow Designer For Native Files For Prepress Purposes Only?


I am the graphic designer and sole prepress person for a small quick print shop. I often come across issues with a file to be printed and cannot make the needed changes or compensations as they arise due to the file hand-off from the clients' designer. For example, we use EFI Fiery Command Workstation to print our jobs and it sometimes misinterprets .PDF files, especially element-heavy files created in InDesign which uses transparencies, and results in a loss of elements. Or, the client is requesting the printed file to match a certain existing copy which requires color correction to mimic the final... Even if the desired customer copy in question was printed with the colors over-saturated and blown out ("We want people to know how bright the place is" was her defense...)


I often come to issues with the clients' designer because they do not want to give me the native files. I understand the value of native files to a designer, and that the contract may not include the hand-off of the working files. However, I am not their client -- I am just someone in the process of making sure their printed work looks best for their client. I am the PREPRESS person trying to make sure THEIR client is happy with their printed piece.


How should I communicate to the designer that I need their native files for prepress purposes ONLY? Is that even acceptable? We have missed deadlines in the past for our clients because their designer cannot make the needed changes in time, or does it incorrectly, or not at all.


It's driving me nuts!


Thank you!





Sunday, December 30, 2018

How to not steal characters


I know I've recently asked a lot of questions. But I do have a lot of questions, I'm a curious kid who wants to do things right...


How do I make the character similar to the one I like, but not so similar I'm stealing?


I get motivated by my obsessions. Some people have obsessions of sweet treats, singers, or hobbies. I usually get obsessed by characters. And I might sometimes add a character like that character to my story. Some of the characters I add seem a bit too close to what I'm getting inspiration from. Like, if a character had white wings, mine might have white wings. (Just an example)



Answer



Learning is copying.


As Erin pointed out, writers tend to go through a fan fiction stage. I did. A crucial difference, however, is that I did not start my "writing career" with fan fics. I always told stories. When I was a kid that had just learned how to write, I invented my own version of Atlantis and wrote a story about a girl that had to find her parents. (My mother had type it into our computer, because I was too young to do it myself.) After this, it was a story about an native American girl that was, by magic, transported to medieval Paris. That was in 2001 and this very weird story about cross-Atlantic communication produced a set of characters that I still love today. Only afterwards did I start to write fan fictions. I loved Harry Potter (and, yes, Dragonball) and was so curious about the characters I had to invent my "own" stories about them. Characters, for me, are the essence of a story, so it was natural for me to tell my stories with "stolen" characters.



And that's where things finally went wrong. At some point, I realized that the characters I loved so much were not suitable to tell my stories. On the contrary, they severely restricted my stories. I remember the last fan fic I wrote, a kind of bridge story -- it was about a Harry Potter character that got Shanghaied into a (literal) mirror world and had to find his way back. And guess who populated the mirror world? The characters I invented for my Paris story, and a bald priest suffering from cancer. (The things you remember ... If I could free up all the space in my brain that is occupied by useless knowledge, I'm pretty sure I could win a Nobel prize.) When I wrote this fan fic, I realized: Hey, your own characters are much more fun to work with, and your stories are not limited by the rules of external worlds. You can make up your own rules and craft the world you use exactly to the needs of your story.


You won't believe how liberating this was.


In a more abstract sense, what happened to me is this: I always had a craving to tell stories. During my "learning stage", I shamelessly "stole" the characters that I loved and explored what kind of stories I liked. At some point, I had developed my own style, and that was when "stolen" characters were not sufficient anymore to tell the stories that I love. I think, writing fan fics was an important step for me to learn how to use and harvest my individual creativity.


To answer your question: Keep writing. Find out what it is that fascinates you about the characters you are obsessed with. Distill this fascination and put it into into your own stories. With time, these stories will become ever more genuine -- and at this point, you will learn to love your own characters better than external characters.


Additionally, keep in mind that characters don't pop into your head fully fledged. You need to get to know them, and that requires work and a lot of time. The more you work with your characters, the more distinct they will become from characters that are external to you.


(Side note: I've noticed that there's certain archetypes of characters that keep recurring. Remember the Paris characters I mentioned earlier? One of them started out as the chief of a band of gypsies. In later stories, he turned into a sailor, and these days he's the bosun of a cruise ship from the 1960s. I radically changed his background and surroundings, but he still, in essence, is the same character. And the fun thing? He turns up in other stories, too, especially from female or gay German authors. The first time I noticed was in Cornelia Funke's Inkheart. I needed two sentences about Dustfinger to be absolutely sure: Hey, that's actually my character, but with a different name. I never had to revise this statement, because it turned out to be true, even after three volumes. I haven't understood yet, why this is, but I swear that I developed my character 100% independently from Inkheart.)


font design - How should I approach designing special characters I am unfamiliar with when designing a typeface?


When designing a typeface there are a number of characters that I, as an English speaker, have never used, rarely seen and simply don't understand. These characters fall in to a number of different groups, but all cause the same problem. I don't know how to design them!


There are mathematical symbols. Not being a mathematician, there are some of these I am familiar with, some I am not. But even the symbols I am familiar with can cause me problems. How do I design a plus and minus sign? I know what shape they should be, but what about alignment? Should the minus sign have the same vertical alignment as a hyphen? It often doesn't but I don't know why. When I get to symbols I don't even understand the use of I am totally lost.



Some examples of mathematical symbols I am unsure of:


enter image description here


There are Non-English characters and diacritics. I don't speak any languages that use any characters other than the standard 26 letters of the English alphabet. I have no idea how diacritics are used or should look. I also have no idea about characters like ß (sharp S), þ (Thorn) or ð (Eth).


Some examples of of characters I am unsure of:


enter image description here


My current approach is to find a font similar in weight and proportions to the font I am designing and using that as a base to design from, but I'm worried I may be getting things wrong.


Are there any official sources that describe how symbols and characters should be designed? And more generally—How do I approach designing characters I am unfamiliar with?



Answer



The following is very general (the last point will explain why), but mostly based on my experience with creating several special characters (most of languages I do not speak) for a blackletter font:





  1. Search the Internet for design instructions from somebody from the community that uses a character, e.g., speakers of the languages that uses it. For letters, I try to maintain a list in this answer. Wikipedia is also not the worst source in this respect.




  2. Take a look at existing typefaces that you expect to pay attention to properly implementing a character and try to identify possible design paradigms. Unfortunately this is easier said than done as even professional fonts may botch some special characters. Use your insights from point 1 to identify such bad typefaces.


    In particular see whether you can find typefaces from type designers that should be familiar with the respective special characters, e.g., take a look at fonts from German type designers if you want to see proper ß designs.


    The important thing here is to look for design paradigms rather than for fonts that are as similar as possible to your font.




  3. Take a look at professional texts typeset in the respective languages. Be careful with texts from roughly 1980 to 2010 (the age of shitty computer typesetting and bad special-character support).





  4. Try to get familiar with a character’s history and usage. For example, from the history of the ß you can learn that the left half originates from the letter ſ (long s) which in turn looks like the letter f without a bar. Thus the left half of your ß should almost always look like your f without the bar.




  5. Use your brain and intuition. For example, the minus should look like the vertical bar of your plus. Also, if you consider some special character design to look ugly, out of place, too difficult to distinguish from other characters, etc., it probably isn’t good.




  6. Ask a question on this site about that specific character. Stack Exchange is aspiring to accumlate such information and is very likely to last longer than privately hosted sites about a single language’s special characters. And even if Stack Exchange should go down one day, the CC licensing and available data dumps make it very likely that the information survives.





As a sidenote: Do not worry too much about mathematical typsetting. There are special fonts for this purpose. If you do not want to design such a font, it needs to be suited for everyday typesetting, nothing more.


risk neutral measure - How to price this basket option?


Underlying assets are three global stock index : Eurostoxx 50, HSI, KOSPI 200



Maturity: 36 months with advanced redemption date in every 6 months if prices of indexes satisfy given conditions at each date.


Payoff : 4.5%(annually)


In the case where prices of each indexes at the maturity date are all less than 60% of the prices at the initial date, you get loss.


I want to use Monte Carlo Simulation using R.


I plan to determine the expected returns and co-variance matrix of three indexes from historical data and generate random numbers which follow multivariate normal distribution.


Using those random numbers, I will generate paths of each stock indexes and determine the total payoff.


However, determining the expected return or variance is hard because, lately, historical returns of some of indexes are not good, not even positive.


How can I determine that? Also, If you give me any idea of improving or implementing this simulation, I'd really appreciate that.


Thank you.



Answer




No offense but it will be much more complicated than what you think... I'm not even sure that you are familiar with risk-neutral pricing in the first place? I'll try to give you some clues.


This security is called a basket option. On top of the multi-asset feature, there are non-trivial mechanisms embedded in the contract you mention:



  • an auto-callable feature, meaning early redemption can happen if certain conditions are met at discrete observation dates specified as part of the contract.

  • a compo/quanto feature. Because individual indices are not denominated in the same currency, either you define the basket $t$-value by converting each individual index's $t$-value in a fixed reference currency (compo) or you simply view these indices values as plain 'numbers' and express their weighted sum in a fixed reference currency regardless of the original denominations (quanto).


Let's forget about the auto-callable and quanto/compo features (as they would require a post of their own to be correctly addressed) and focus only on the basket part for the moment.


Omitting these features makes the payoff purely European i.e. it only depends on the terminal value of the basket ($T$-value). Let's denote it by $\phi(B_T)$, where in your case $\phi$ looks like the payoff of a put (or possibly a down-and-in put it's not clear from your explanation).


Let's also assume deterministic and constant rates in what follows, along with proportional dividends for the sake of clarity. The model categories I list below only reflect my own views, there is no such distinction in practice.


Pricing 101



Under the risk-neutral measure $\mathbb{Q}$ the price of an option is given by: $$ V_0 = e^{-r T} \mathbb{E}_0^\mathbb{Q} \left[ \phi(B_T) \right] $$ with here $$B_t = \frac{1}{N} \sum_{i=1}^N S_t^{(i)} $$ the $t$-value of the basket, $r$ the risk-free rate (rate at which money can be deposited on the money market, here you can take the EONIA discount curve for instance).


Mathematically, the risk-neutral measure $\mathbb{Q}$ is defined in such way that: $$ F(0,T) = \mathbb{E}_0^\mathbb{Q}[ S_T ] $$ where $F(0,T)$ is the forward price at $T$ of the equity $S$ as seen of $t=0$.


There is a lot of theory hidden behind the last few equations, I would recommend you to investigate that using a good reference book e.g. Shreve. Maybe this post is a good start also. Anyway, the consequence is that your model should eventually read something like:


$$ \frac{dS_t^{(i)}}{S_t^{(i)}} = \frac{\partial \ln F^{(i)}(0,t)}{\partial t} dt + \sigma^{(i)}(...) dW_t^{(i),\mathbb{Q}} $$ with a certain dependence structure between the Brownian motions driving the individual indices' prices.


Basket Pricing 101


From the above you see that: $$ V_0 = e^{-rT} \int_0^\infty \phi(B_T) p(B_T) dB_T $$ in other words, if you know the probability distribution of $B_T$ you are done, since you can either: (1) perform a numerical quadrature and get the option price (2) sample from the terminal distribution and compute the expectation using Monte Carlo simulations. (1) is when $p(B_T)$ is known in closed-form, (2) is more general.


It is straightforward to show that the first 2 moments of $B_T$ under $\mathbb{Q}$ are: $$ B(0,T) = \mathbb{E}_0^\mathbb{Q}[B_T] = \frac{1}{N} \sum_{i=1}^N F^{(i)}(0,T) $$ (i.e. sum of the expectations) $$ \sigma^2_B = \frac{1}{N^2} \left( \sum_{i=1}^N \sigma^{2,(i)} + 2 \sum_{j=1}^i \rho_{ij} \sigma^{(i)} \sigma^{(j)} \right) $$ (i.e. sum of the covariances)


[Model Type 1]


Assume $B_T$ is log-normal with first moments given by the above. This is a mere approximation since we know that the sum of $N$ log-normal variables is not a log-normal. But it allows you to compute the price of a basket using the BS formula: $$ V_0 = e^{-rT} ( B(0,T) N(d_+) - K N(d_-) ) $$ $$ d_\pm = \frac{\ln\left(\frac{B(0,T)}{K}\right) \pm \frac{1}{2}\sigma^2_B T}{\sigma_B \sqrt{T}} $$


[Model Type 2]



Use a shifted log-normal to approximate $\phi(B_T)$, or any other known distribution for that matter. The idea is that you already know the first 2 theoretical moments of $B_T$ and you can easily write the third and even the fourth moments using standard calculus. You then fit the known distribution to the unknown distribution of $B_T$ by matching their moments. This is known as moment-matching. In the case of a shifted-lognormal, this leads to a closed-form formula.


[Model Type 3]


You consider the true marginals of each individual asset $S_t^{(i)}$ i.e. $$ p^{(i)}(x) = \frac{d F^{(i)}(x)}{d x} = \frac{d \mathbb{Q}\left(S_T^{(i)} \leq x\right)}{ dx} $$ where $F^{(i)}$ is the $i^{th}$ asset cumulative distribution function.


You can infer the above risk-neutral probabilities from listed option prices using the Breeden-Litzenberger idendtity, see here.


Now that you have identified the marginal distributions of each asset $S_t^{(i)}$, you need to define their dependence structure so that you can eventually obtain their joint distribution from which you will be able to infer the distribution of $B_t$ since: $$ p(B_t \in A) = \int_{\frac{1}{N} \sum_{i=1}^N x_i \in A} p\left(x_1,...,x_N\right) dx_1 ... dx_N $$ You can use copulas, to form the joint distribution $F^B(x)$ from the knowledge of the marginals $F^{(i)}(x)$.


[Basket model $\infty$] There are of course many variations of the above methods




  • Depending on the choice of copulas used in model 3 above for instance. Gaussian is the usual go-to choice, but you could pick any other dependence structure. One which accounts for the fact that correlations explode when the market crashes seems like a better option. See the problem of correlation skew.





  • You could use local volatility + instantaneous correlations as a replacement for coupling individual marginals with a Gaussian copula. Choosing different copulas then amounts to defining different local correlation structures. This is still an open research subject, see the work of Langnau, Guyon etc. in this area.



  • Be careful with decorrelation issues and the famous instantaneous vs. terminal correlation debate


[Additional details]




  • To price in the auto-callable feature it may be interesting to set up a hybrid equity-rates model (i.e. work with stochastic interest rates).





  • For the same reason, it might also be useful to consider discrete cash dividends instead of discrete proportional dividends.




  • To price in the compo feature you'll need to know the FX forwards. To price in the quanto feature you'll need to know the FX volatilities (see quanto drift adjustment) and sometimes more depending on whether you regard the equity volatility as a stochastic process or not.




[Your implementation]


You may wonder as to what model your implementation corresponds. Assuming you used the appropriate equity forward curves to build the risk-neutral drifts of the individual indices + used an implied volatility number (i.e. not quantities estimated under the real-world measure $\mathbb{P}$ such as expected returns and historical volatility, but rather quantities inferred from listed option prices provided under $\mathbb{Q}$), what you did corresponds to postulating log-normal marginals combined through a Gaussian copula.


This is in-between model 1 (which is worse than yours because it assumes $B_t$ is log-normally distributed but exhibits correct first 2 moments) and model 3 (which is better than yours because it uses the true implied maringals and not a log-normal assumption for the marginals).



Good luck


Asirra or Captcha?


I've just heard about "Asirra" and tried it. But, I am a little bit confusing about using. What is your choice for usability?


Asirra or CAPTCHA, and why?




Answer



CAPTCHA is Completely Automated Public Turing test to tell Computers and Humans Apart. So, indeed, Asirra is (a type of) CAPTCHA... If you mean the warped text type of it, I think Asirra is not useful because:



  • it requires more time than warped text

  • it requires specific interest while trying to fit in a design


I think best type/way is reCaptcha.


Saturday, December 29, 2018

usability - Paging and Bookmarking


Lets say I have blog and I keep on adding Posts. So on day 1 it will show 5 posts on page 1 and someone bookmarks it. Next day I add 10 more post and someone opens the bookmark. They see completely different result.


This happens on all the sites. Is there a solution to this?




opentype - How to find out whether a font is authentic?


Is there a way to find out whether a font is authentic or fake? Font files both online and on my machine are often of unclear origin, yet I'd like to be sure that I paid for the fonts that are commercially available and that I have a genuine original.


Is there a way to check the authenticity of a font file?


I am interested mostly in Type 1 fonts (.pfm and .pfb files), but also an answer for Open Type (otf) and True Type (.ttf) would certainly be useful.




terminology - Is there an industry term for a ribbon wrapping the corner of a design element?


Is there an industry term for a ribbon wrapping the corner of a design element? I'm going to be referring to this a lot in the near future, and it would be great if I could call it something more intelligent than "The corner ribbon thingy"


One example of what I'm talking about is on the site: http://www.brasseriegerard.co.uk/ The right-hand div has three elements which it rotates through. The first element has a red 'New' ribbon wrapping the corner of it.


Thank you!



Answer



I've heard it called a "snipe" by someone with 30 years in the advertising business. We also called it a "corner hat."


Fama-French Data from daily to monthly returns


Ken French on his website publishes daily, monthly and yearly returns for the Fama-French 3 Factors model which are excess market (Rm-Rf), small-minus-big (SMB) and high-minus-low (HML) returns.


I don't understand how he converts daily to monthly returns. For example for the last month the daily returns are


           Mkt-RF     SMB     HML      RF
20150501 1.01 -0.33 -0.60 0.000
20150504 0.32 0.06 0.16 0.000
20150505 -1.19 -0.10 0.34 0.000
20150506 -0.31 0.62 -0.20 0.000
20150507 0.39 0.03 -0.43 0.000

20150508 1.21 -0.54 -0.21 0.000
20150511 -0.39 0.67 -0.11 0.000
20150512 -0.27 0.00 0.11 0.000
20150513 0.01 0.02 -0.06 0.000
20150514 1.01 -0.10 -0.36 0.000
20150515 0.05 -0.26 -0.01 0.000
20150518 0.44 0.72 -0.09 0.000
20150519 -0.09 -0.08 0.03 0.000
20150520 -0.05 0.21 -0.09 0.000
20150521 0.23 -0.31 0.09 0.000

20150522 -0.22 -0.11 -0.14 0.000
20150526 -1.01 -0.04 -0.02 0.000
20150527 0.93 0.33 -0.39 0.000
20150528 -0.11 0.11 0.07 0.000
20150529 -0.58 0.02 0.05 0.000

And the monthly returns are


        Mkt-RF     SMB     HML      RF
201505 1.36 0.92 -1.89 0.00


For example to convert the daily Mkt-RF return to a monthly returns I use the following formula


$$ \text{ret}_\text{monthly} = \left(\prod_{i\in\text{day}} \left(\frac{\text{Mkt-RF}_i}{100} + 1\right) - 1 \right)*100 $$


which is


$$ \text{ret}_\text{monthly} = \left[\left( \left(\frac{1.01}{100} + 1\right)\times \left(\frac{0.32}{100} + 1\right)\times\cdots\times \left(\frac{(-0.58}{100} + 1\right) \right) - 1\right]\times100 $$


So I find the following monthly returns


               CUSTOM CALCULATIONS
Mkt-RF SMB HML RF
201505 1.35 0.91 -1.85 0.00

I don't understand why I get these differences. What am I doing wrong?





Friday, December 28, 2018

mobile - How should modal popups and tool tips be handled in responsive websites?


I am reviewing some website wireframes from a client and have decided to make the new site responsive. I've had pretty good luck so far with responsive theming and design from a few past projects and they look and act really nice across widths / devices.


However this particular wireframe has quite a few modals and hover windows with lots of information in them.


My questions are:



  1. Will this be like trying to fit a square peg in a round hole?

  2. Do we need to perhaps go the m.domain.com route where we query the device and design two separate websites?

  3. Should I advise the client to do away with so many modals and hover windows if we go the Responsive route?



I know these are subjective questions so not really sure if this is appropriate within this type of forum.



Answer




Should I advise the client to do away with so many modals and hover windows if we go the Responsive route?



I'd restate that question as:


Should I advise the client to do away with so many modals and hover windows?


And the answer to that is, usually, yes.


But not always. If it's a very complex desktop-centric site, maybe modals are a good option there.



The catch is that on mobile devices, modals are somewhat useless, given that the size of the screen usually means that a modal smaller than that, is rarely useful.


You could consider having two forms of modals...the pop-up on big screens, the separate page on mobile. How easy/difficult that may be to implement, I don't know.


What is best practice for consistency across different products?


We have a debate in the organization (a small startup) on what should be consistent across our two web based products. However, the target user group is different for each product and the use cases are completely different, e.g. use cases are for a different specialty and content.


What are the best practices for consistency across products? Especially if they are different user groups?


We've had internal debates on keeping all of our products the same layout, same font styles, widgets, behaviors, etc. However, since the users and use cases are completely different, I have promoted different layouts for each app (vs a uniform) because one layout cannot meet the needs of the two user groups. But keep the brand consistent across.


Consistency defined by the following from smashing ux design:



  • Info Architecture / Layout

  • Fonts, colors and styles

  • Behavior Consistency: Pattern reuse

  • Behavior Consistency: unified nomenclature, reuse




Answer



There are many different levels of consistency that are applicable in UX design, so you need to define what the goals are and align the strategies so that you can get consistency where you need it, and help differentiate the experience where required.


For example, from the business perspective you could be talking about the brand consistency and identity that is linked to the company or organisation. The brand consistency is generally on a visual and content level, but it sets the general look and feel for the products and services under the brand. A very large organisation could have more than one brand (one of which is the corporate branding of the organisation), so there needs to be a high level strategic business decision on how the brands relate to each other.


From the design perspective you are probably talking about the visual, content and interaction design consistency. Some of the consistency comes from the underlying technology used to build the products or services, so ensuring that there is a solid and adaptable frontend development platform and minimizing the impact of legacy systems will go a long way to ensure that there are as little constraint in creating a uniform design and development guideline for your suite of products and services.


From an individual product perspective you are looking at the overlap and cross-section of users for the different products and services with respect to the brands (if applicable). I think this is where the biggest different will come from, but more so from the presentation layer of the visual perspective (colours, logos, fonts, etc) rather than the underlying content and interaction that are derived from a common design framework.


I usually encourage the practice of maintaining a series of documents that outline the purpose and relationship between the standards and guidelines developed for the company, so that these types of questions can be answered by UX designers and developers working on different projects.


numerical methods - How to remove outliers in financial times series?


I have a bunch of time series; i need to clean them before modelling. So far I just know the “filtering/smoothing” method : -Ex: moving average methodology (filter the data with a moving average (filter), then obtain a noise (serie minus filter) and remove data points which correspond to a high noise (i.e with a specific threshold) :


(simple) Example of the moving average filter method with three outliers :


Data and filter : enter image description here Noise and threshold : enter image description here Cleaned data : enter image description here


Do you recommend a specific filter ? do you know a better automatic method ?



Answer



Not so fast! I think it is of the utmost importance to first examine whether the data points are real outliers, i.e. noise that is contaminating the data, or perhaps the most important pieces of the time series!


For example when you look at US stock market data of the last 50 years and remove only the ten biggest moves because they are outliers you get a completely different time series!



See page 276 of The Black Swan from Nassim Taleb


So you have to be extremely careful and double check all the data points you remove by whatever available method out there!


In general what you consider an outlier also very much depends on the model you are using. So what seems to be an outlier in one model (e.g. a linear model) is part of the package in a more complex model (e.g. a non-linear model). So it is also a matter of experience how to proceed.


So all in all I think there is no easy answer to your question. A good starting point may be the first chapter of the following new book (2013) which is available online:


Outlier analysis by C. Aggarwal


On a more practical note you can use the forecast-package in R in its new version 5.0 from Rob Hyndman. The new version was just released (27/01/2014) and has upgraded functionality for preprocessing time series and outliers:


http://robjhyndman.com/hyndsight/forecast5/


shapes - How to create an outlined circle with centered horizontal and vertical gaps in Illustrator?


Could you explain to me, how I can draw a shape like the one in the following image?


How can I cut any part of circle to get such 4 shapes with Adobe Illustrator?


enter image description here




icons - Showing which direction a value should go towards


I have an interesting UI challenge. I have a ratio that I am showing in two ways: one using a percentage surrounded by a circumference pie chart, and the other showing a status bar. In some cases a higher percentage is better and in other cases a lower percentage is better. I am trying to come up with an intuitive way to show which direction the data should be heading towards (0 or 100%) without using arrows that will draw the user's attention away.


ui design


In this example, we have a population of patients and we're trying to measure how well they are being cared for at a hospital. Let's say 23 patients out of a possible 46 patients with diabetes had a foot exam in the past year. In this case, a higher numerator is better. Now let's say 23 patients out of a possible 46 patients with heart problems were given incorrect heart medication. In this case, a lower numerator is better.


It would make things a lot easier if I could change how these measures are worded (ex. change incorrect medication to correct medication in the second example above), but I cannot do so. So, how do I create a UI that conveys this information while keeping the design simple and sleek (uni-color flat)?




Thursday, December 27, 2018

adobe illustrator - How to align several objects on the same x coordianate?


I have several objects with different x coordinates. If I select them all and transform them to a x coordinate Illustrator sets the x coordinates relative to the selection as a whole. I want to set the x coordinate for all objects the same.


So: The objects should be in line below each other, starting at the same x. Is there any way to do it? I don't want to set the x coordinate for the objects separatly.



Answer



Use the Align tool Window > Align (Shift + F7) and select Horizontal Align.




enter image description here


Make sure you select what you are trying to align it to.





  • Artboard - Align it all with the center of the artboard




  • Selection - Average it out in the middle (all will still be perfectly aligned)




  • Key Object - Align it to the selection which has the Bold outline (you can change the key object by just clicking on a different object)





software recommendation - Is there a free service/website/method of testing an HTML email in a specific client?


I have designed an HTML email template for a client and it works fine everywhere except, according to the client, Outlook 2013.


I don't have access to Outlook 2013 but it would be very helpful if I did. I know there are some services (like MailChimp) that provide the ability to preview your email in multiple email clients for a price but are there any free options?




copyright - Showing a competitor's product in ad: legal?


So my client wants to show a photo image of their competitor's product in an ad of theirs. The ad is implying that the competitor's product is bad/obsolete. Is this legal?


I know that you can't use a photo of the product without proper rights, which the competitor is unlikely to grant. And lifting it off of Google Shopping probably won't fly either. If it shows up in a stock photo though, that might work?


Any other reasons I can tell my client to stop trying to do this?



Answer




You can definitely do it. It's risky and you have to be very careful. Basically, you want to imply that it's your competitor's product without ever showing one of their images or mentioning their brand or product name.


The best way to keep you and your client out of the line of fire is to hint at the competition rather than openly addressing them. One of the best, most recent examples of this is ads created by competitors to the iPhone.


The iPhone 7 doesn't have a headphone jack, right? So companies like Google (when announcing the Pixel) say things like "and oh yeah it has a headphone jack too." This way they get to poke fun at the iPhone 7 without ever mentioning Apple or its specific product. It's a risk-free jab.


Now for an example with a picture. (I swear I don't have an issue with Apple.)


Motorola makes fun of iPhone


So here, you can see that they displayed the competition's product openly, but removed all of their branding (in this case, they didn't have to do much for that). However, everyone who is in the market for a smartphone knows that the phone on the left is an iPhone. (And "#iLost" clues you in if you weren't already getting it)


Basically, what I'm saying is that it can be done but you have to be very smart about it. Depending on where you are and how much your client wants to rip on the competition, you could be facing a slandering lawsuit if you're not careful.


If your client still insists on going ahead with using the competition's imagery, just make sure you don't lie about their product and its capabilities.


Additional note! Do not pull images off of the web unless you are certain that you have a right to use them in your own ad.


Why $N(d_1)$ and $N(d_2)$ are different in Black & Scholes


I'm struggling to understand the meaning of $d_1$ and $d_2$ in Black & Scholes formula and why they're different from each other.


As per the formula, $$C = SN(d_1) - e^{-rT}XN(d_2)$$


which means if the call option gets exercised, one would receive the stock and pay the strike price.


Clearly, the strike price payment is conditional on the option finishing in the money, ie. future value of this payment is $X \cdot \mathbb{P} (S_T > X)$ and thus discounted present value would be $$e^{-rT}X \cdot \mathbb{P} (S_T > X)$$


From this we can see that Black & Scholes $N(d_2)$ is the probability of the option exercise (under risk neutral measure).


But then it should logically follow that the first part of the formula - conditional receipt of the stock - should equally depend on the above probability, in which case its future value would be $S e^{rT} \cdot \mathbb{P} (S_T > X)$, with the present value $S \cdot \mathbb{P} (S_T > X)$, and so Black & Scholes formula "should be" $$C = SN(d_2) - e^{-rT}XN(d_2)$$



But the formula does use $N(d_1)$ and since $d_1 > d_2$ my understanding is that it gives higher probability to receiving the stock than to paying the strike price.


I went through Understanding $N(d_1)$ and $N(d_2)$: Risk-Adjusted Probabilities in the Black & Scholes Model and also found this explanation on Quora helpful, but still don't see what is fundamentally wrong with the train of thought I described above.



Answer



The time-$t$ price of a European call on a non-dividend paying stock with spot price $S_t$, when the strike is $K$ and the time to maturity is $\tau = T − t$, is the discounted expected value of the payoff under the risk-neutral measure $Q$ $$C(t,{{S}_{t}},K,T)={{e}^{-r(T-t)}}\mathbb{E}_{t}^{Q}\,[{{({{S}_{T}}-K)}^{+}}]={{e}^{-r\tau }}\mathbb{E}_{t}^{Q}[({{S}_{T}}-K\,)\,{{1}_{\,{{S}_{T}}>K}}]$$ where $1$ is the indicator function,thus we have $$C(t,{{S}_{t}},K,T)=\underbrace{{{e}^{-r\tau }}\,\mathbb{E}_{t}^{Q}[S_T\,1_{S_T>K}]}_{J}-K e^{-r\tau}\,\underbrace{\mathbb{E}_{t}^{Q}[1_{S_T>K}]}_{I}$$ We can therefore write $$I=\mathbb{E}_{t}^{Q}[ 1_{S_T>K}]=Q(S_T>K)$$ Indeed,the expected value $\mathbb{E}_{t}^{Q}[ 1_{S_T>K}]$ is the probability of the call expiring in-the-money under the measure $Q$.


Evaluating $J={{e}^{-r\tau }}\,\mathbb{E}_{t}^{Q}[S_T\,1_{S_T>K}]$ requires changing the original measure $Q$ to another measure $Q^S$.Consider the Radon-Nikodym derivative $$\frac{dQ^S}{dQ}=\frac{{{S}_{T}}/{{S}_{t}}}{{{B}_{T}}/{{B}_{t}}}$$ where $d{{B}_{t}}=r{{B}_{t}}dt$ or $B_t=e^{rt}$. As a result $${{e}^{-r\tau }}\mathbb{E}_{t}^{Q}[{{S}_{T}}{{1}_{{{S}_{T}}>K}}]={{S}_{t}}\mathbb{E}_{t}^{Q}\left[{{e}^{-r\tau }}\frac{{{S}_{T}}}{{{S}_{t}}}{{1}_{{{S}_{T}}>K}}\right]={{S}_{t}}\mathbb{E}_{t}^{Q}\left[\frac{{{S}_{T}}/{{S}_{t}}}{{{B}_{T}}/{{B}_{t}}}{{1}_{{{S}_{T}}>K}}\right]={{S}_{t}}\mathbb{E}_{t}^{{{Q}^{S}}}[{{1}_{{{S}_{T}}>K}}]$$ in othere words $$J={{e}^{-r\tau }}\,\mathbb{E}_{t}^{Q}[{{S}_{T}}{{1}_{{{S}_{T}}>K}}]={{S}_{t}}\mathbb{E}_{t}^{{{Q}^{S}}}[{{1}_{{{S}_{T}}>K}}]=S_t Q^S(S_T>K)$$ This implies that the European call price of Equation be written in terms of both measures as $$C(t,{{S}_{t}},K,T)=S_t Q^S(S_T>K)- {{e}^{-r\tau}}K Q(S_T>K)$$ Under measure $Q$, $S_T$ is distributed as lognormal with mean $m=\ln S_t+(r-\frac{1}{2}\sigma^2)\tau$ and variance $\Sigma=\sigma^2\tau$ then


$$Q(S_T>K)=N\left(\frac{m-\ln K}{\sqrt{\Sigma}}\right)=N\left(\frac{\ln(S_T/K)+(r-\frac{1}{2}\sigma^2)\tau}{\sigma\sqrt{\tau}}\right)=N(d_2)$$


stochastic processes - Strictly local martingales: what is the intuition behind them?



A process $X_t$ is a local martingale if for each increasing sequence of stopping times $\{\tau_k,k=1,2,...\}$ the stopped process is a martingale. All true martingales are local martingales, but the inverse is not true. A strict local martingale is a local martingale which is not a true martigale. In fact, a positive strict local martingale is a supermartingale -- i.e. the expectation decreases with horizon.


In quant finance strictly local martingales have appeared as models which exhibit volatility induced stationarity or models that describe financial bubbles.


All Ito processes desrcibed by a 'driftless SDE' are in fact local martingales, but not martingales (which is surprising to many). For example the familiar Geometric Brownian motion $$dX_t = X_t\ dW_t$$ is a local martingale and a true martingale, while the CEV model with exponent greater than one $$dY_t = Y_t^\alpha\ dW_t \text{ (for given }\alpha > 1\text{)}$$ is a local martingale but not a true martingale. In fact, starting from $Y_0$ the expectation $$E[Y_t|\mathcal{F}_0] < Y_0 \text{ (for all }t>0\text{)}$$


My question is on the intution behind their dynamics and paths:



  • What are the qualitative features that break the martingality for such a process as $\alpha$ crosses 1?

  • How do paths of strict local martingales look like (against true martingales)? They are not explosive, they are not hitting zero, and I cannot see anything particularly 'strange' or 'unusual' when I plot them.

  • How come that even when I simulate this process (with Euler) I get a negative drift, even though I am adding up a finite number of Gaussians with zero mean (although strictly local martingales are only a continuous time phenomenon)?


This blog post discusses these points, but I am looking for something more high level and (if possible) intuitive.





Tuesday, December 25, 2018

illustration - Are graphics tablets worth it?


I've always felt curious about graphics tablets, but I've never even used one. Most people I know either give up or love them.


I'm not a big illustrator myself, but I do the occasional doodle and would like to know if there are any other advantages for non-illustrators.




Answer



I'm primarily a web developer and designer, so I do most of my work directly in Photoshop/Gimp cutting and clipping and filtering. I eventually stumbled upon the opportunity to purchase a very inexpensive reconditioned Dell Latitude XT, and my experience has been pretty positive. It allows me to much more easily create masks, draw layers, make my selections, etc. The pressure sensitivity is a huge plus, as it frees me up to make minor tweaks without having to constantly re-size my brush or keep my hand on a slider while I mouse-draw.


A few things to be aware of:


1) There are a variety of sizes and styles of tablets, but the industry standard is mostly assumed to belong to Wacom. You can see their products here: http://www.wacom.com/ . As you can see, they provide products for both industry professionals and home/office users at a variety of price points. I would recommend trying out the Bamboo series as a first tablet.


2) If you choose to purchase something other than a Wacom device, be aware that they use a different API to interface with the tablet program and your OS than Wacom does, and they are not completely inter-compatible (especially with Adobe's products). NTrig, the makers of the touch-screen technology for both the XT and the HP TouchSmart have released new multi-touch and pressure-sensitive patches for their devices, which also makes them compatible with the WinTab API, so this is no longer as big of an issue, but it still causes compatibility problems with certain applications.


3) It mostly imitates the feeling of traditional media, but you'll find that it's not a true replacement. I'm terrible with a pen or pencil these days, but my dexterity with the tablet has gotten a lot better; these skills are not completely interchangeable.


Good luck, and enjoy!


How to manually type in handles for anchor in Adobe Illustrator?


In Illustrator CS 5.1, I would like to manually type in the points for handles on an anchor point, as I need to be more exact than moving them with my mouse. How can I do this?




design principles - What technical/objective qualities do good logos have?


What objective (that is, not aesthetic) qualities should (almost) every logo have, that should you take into account when designing a logo or ask for when hiring someone to create a logo for you and why?


For example, a logo has to look good in black and white and not only in full color because even if you design the logo for a web site it's very likely you will need to print a B&W document with the logo sometime in the future.





typing - Is it worth switching to Dvorak?


I've occasionally thought about trying the Dvorak keyboard layout to improve my writing speed. However, I wonder if the speed gain is really worth the initial learning curve.


I'm curious if anyone knows of studies that tested people switching from Querty to Dvorak. Specifically, how long does it take the average person to recover their previous speed, and how much does their speed improve overall?


I would also be interested in any anecdotal evidence by those who have made the switch (or attempted it and reverted back to Querty).




Answer



Personally I switched to Dvorak about six years ago, and I've found it to have been a net positive over all. My typing speed is about the same as before, though oddly my error rate has gone down. On the other hand, I haven't had any serious wrist pain since I switched.


There are some downsides to switching.



  • It seems to take about two months to get back up to the speed you were before changing over.

  • Your QWERTY typing speed will suffer unless you put time into working with both.

  • You're also going to have to learn how to type without looking at the keyboard as the odds are pretty good you're not going to be able to change the key labels. (You can find blank keyboards if the mismatch is a problem)


If you do try to change over, I'll warn you that the third week or so will be the worst. You'll kind of know where everything should be but you'll have a hard time finding it. Typing will be a huge pain for a few days as everything starts to properly shift around in your head. If you can get through it though, it will get better after that.


language - Why does Stack Exchange require you to click to be turned down?




On any Stack Exchange site you can't vote for your own question.


So, Why does it give you the option, and then reject your vote? Would it not be better just not to have the option?


This way they are not receiving negative commands?


An alternative would be to have the rating but not show the arrows...


Enter image description here



Answer



I believe there are two aspects to it.



  • So that you can see the number of upvotes\downvotes you have got on your question\answer : If they had to somehow disable it, they would have to find a way of communicating that it was disabled for you while showing the number of upvotes\downvotes which is an additional design change and users will need to figure out what the new look means .



enter image description here



  • Ensuring consistent design : By keeping the design consistent, users can relate to the overall structure and layout easier.To quote this article



ELEMENTS


When I say elements, I mean the footer, sidebar, or navigation. Users will get used to the location of these elements, so they should be kept in the same place. Remember, your website should be logical to the users and that can be accomplished when you have a consistent placement of your elements.



Taking all of this into consideration,it would be an easier and more effective design to just allow users to accidentally discover that self-voting functionality is forbidden.


Monday, December 24, 2018

website design - What's the best way to display reply threads?



I have a post and reply system. Currently when you view a post, you can see a list of its direct replies in a vertical scroller. You then click on a reply to see replies to that. I might call this "breadth" display. However, I have some users complaining that they'd prefer to follow comment threads through replies, i.e. "depth" display. The issue I have is, reply chains follow a tree structure, and it is not easy to decide how to show all these threads at the same time.


My question is: Is there a good or recommended way to display a comment tree? There are similar solutions online, such as Reddit's way of rendering, but most people I've talked to don't find that very intuitive either.




input fields - How to design a form that mostly is read-only, but sometimes editable?


Often in database-centric application I need to design a view for records e.g. something like:


Name: __________
Phone Nr: _________
Website: ______
Email: __________@________

Location: ____________
Address: ______________
______________
Post code: ________

These views are mostly read-only, but sometimes the user needs to edit them.


What is a good way to show them in read-only mode? and what is a good way to switch to editable mode? What is the drawbacks with showing the fields in read-only mode as "disabled" input fields?


E.g. usually I design these views as forms, where the fields are disabled, and I have a "Edit" button that change all fields to enabled. But showing the fields as labels may be an alternative for read-only mode.


But here on StackOverflow, the profile pages are shown as labels/text and switched to forms when the user clicks "edit".



Answer




Showing the normal read-only view as a bunch of disabled form input elements will be visually ugly and contextually confusing; you're making it look like a form that you can't use, and it may not be readily apparent why it's not editable (because it's not a form yet!). You're violating good affordance by making things look like editable forms when they really aren't (in this view). Instead use plain text/lables and present it neatly like it's a piece of paper.


An edit button is a great way to toggle the view and make it clear why this view is read only. The simplest way would be to make the edit button switch to a different page that displays an editable input form.


As you've hit upon with your SE example, the alternative is to make the view only view look like text, but automatically change into a standard form appearance once you hit the edit button.


In a web app you can give this effect by using disabled form elements in your read only view and then style away the input boxes, the "greyed out" effect, ect, so you can easily hide the fact that you're using form elements until you click the edit button, when voilà, it's a form with a standard appearance, aiding affordance in both states.


InDesign: poor rendering of gradient


Is there a way one could improve the rendering of this gradient?


After creating a gradient swatch and applying it to a rectangle that fills the entire page to use as a background, the gradient looks bad so I would like to improve the quality of it and High Quality display performance doesn't change anything:


enter image description here



Answer



Banding within gradients is often a result of color stops being too similar and long distances between stops.



Often, for print work, onscreen gradients will show more banding than a press will. Of course, this is of little help unless you get color proofs or chromakeys from your print provider to check the gradients before printing them.


Since InDesign offers little ability to disperse colors within a gradient. The best you can do is use color stops which are not so similar if possible, or decrease the distance between the color stops.


If you need a "background" gradient, it can often be better to create it in Photoshop where you can add a touch of noise or diffusion to break up any banding which may be present.


How to get this blur texture effect in photoshop?


I'm trying to get an image to look similar to this photo:


Image from Zendesk.com


I'd guess they took a picture of the monitor with a regular camera. But I'm more interested to know what effects / filters they used to get the blur and texture. Any suggestions would be appreciated



Answer



This looks like they applied the tilt shift effect to a photo of a monitor (or maybe they skewed a screenshot)


fiction - How can I avoid a predictable plot?


When writing a novel, authors generally don't want the reader to know how things will end. This is especially true of mystery novels, but obviously applies to any creative story. (A few stories show the end, and then the main question is how that end was achieved. However, the principle of keeping the reader in the dark remains the same.)



For this reason, avoiding a predictable plot is a good thing. You don't want to start setting things up, and then have the reader say to himself: 'Yep, I know how this is going to end.' This question is about how you can avoid creating such a predictable plot.


Here's an example which I recently thought of: Assume I'm writing a fantasy novel which takes place on an isolated island in the middle of the ocean. An amnesia-stricken newcomer arrives in the only village on the island, and quickly learns that life there revolves around escaping the island. The only way to escape the island is by defeating the evil monster keeping everyone from leaving. However, no one has yet been able to slay the monster.


You might not know exactly how, but you can tell that the amnesia-stricken newcomer is going to be the one who kills the monster and frees the people. The story will probably even end with them sailing off into the sunset. Forgetting the cliches for the moment, the plot is easy to predict.


Question: How can I avoid creating such a plot? Or if I have a predictable plot, as in the example above, how can I fix it? Are there simple steps or methods I can follow?


Note: Obviously all readers expect the good guy to win and the conflict to be resolved. That goes without saying. This question goes beyond that, referring to the times when the reader can list things which he knows will happen by the end of the book. It's more than knowing that the good guy will win. It's knowing how he'll win.




One method I've seen used is to establish a predictable plot or plot point, and then do the opposite, only to turn back at the last second. You still end up where the reader expected though, so this doesn't really solve the problem. It simply arrives at the expected outcome through unexpected methods.


An example is The Hunger Games. In the beginning of the first book, we all expect Katniss to enter the Hunger Games. She does, but only after Prim is chosen instead of her. We weren't expecting that, but she still ends up where we knew she would.


As I said, I don't see this as really solving the problem.





Note: Not a duplicate of this question. That question refers more to genre conventions, while this question deals with plot, and keeping the ending hidden from the reader until the last moment.




Sunday, December 23, 2018

website design - Should you place the "add a comment" form above or below the list of comments?


There seems to be very little consistency across most sites when it comes to placing the comment form.


Which do you think is the most usable, above the comments list or below?


Above the list:



  • Disqus

  • YouTube


Below the list:




  • Digg v4

  • Wordpress default template

  • StackOverflow



Answer



I always prefer to think about the use-case I want to encourage, or that is forced by the nature of the site/audience.


If most of your audience will read the content and immediately want to comment, put it on top. If on the other hand you want to encourage people to actually read what others have commented before them and only the respond, it makes more sense to put it on the bottom.


gimp - Batch Processing


I need to batch process 100's of images in one go, these are largely product photographs for my e-commerce store & the task are repetitive such as white background , image resizing,and compressing .


Currently , I use:



  • GIMP - White Background ( Couldn't batch Process for white background)

  • Faststone - for Batch Resizing


I find this laborious & time consuming ? Is there a better way ..Do recommend




inkscape - How to create vector physics diagram with know angles and line proiection


I'm trying to create a triangle vector. I know the length of the first vertical vector A, the angle between this vector and a second vector B and that the third vector C, closing the triangle, is horizontal. How can I make this diagram on Inkscape ? I need to indicate the angle measurement and the vector names. In the image below there is an example of what I'm trying to create, but it is mandatory to construct the triangle starting only from the data that are known (known data are explained above). an example of the triangle I need to draw





usability - How to design usable web site terms & conditions?


What are some guidelines and examples for designing usable legal terms for web sites? I know that most users don't read it, but are there innovative ways to improve readability and presentation of these (traditionally) boring documents?




resource recommendations - What are the key principles that effective designs share?


You have arrived on this page because you are clearly curious about underlying fundamentals that you can incorporate into your thought process when designing.


According to many that came before us, there are key principles that can be considered when creating an effective design. In the following answers, you will find useful theories from a variety of respected sources.



Use this question as a reference for navigating the variety of topics:


Gestalt Principles


  1. Proximity


  2. Alignment


  3. Contrast


  4. Repetition & Consistency


Other Fundamentals and Useful Information


  5. Communication


  6. Laws of Usability


  7. '7 Principles of Universal Design'



  8. '10 Principles of Good Design'


If you know of a topic that hasn't been covered here, please add an answer with references to respected resources and it will be added to the list.


Of course direct quotes and paraphrasing from respected resources are a must, but should be limited to a small paragraph per topic at most and referenced back to their source as thoroughly as possible.


A question very similar in nature has been posted before, but not to create a collection of snippets that are enlightening for graphic designers of any and all skill levels.



Answer




Communication is above all the forefront of effective design. Graphic Design by nature is about communicating an idea. Regardless of medium this is the de facto standard for an effective design.


Quick Historical Look:



Nearly 200 years ago William Playfair (1786) began the serious use of graphs for looking at data. More than 50 years ago a battle raged on the pages of the Journal of the American Statistical Association about the relative merits of bar charts and pie charts (Eells 1926; Croxton 1927; von Huhn 1927). Today graphs are a vital part of statistical data analysis and a vital part of communication in science and technology, business, education, and the mass media.




Source: Graphical perception: Theory, experimentation, and application to the development of graphical methods in the Journal of the American Statistical Association, Vol. 79, No. 387. (Sep., 1984), pp. 531-554.



Larkin and Simon (1987) suggest that the following forms of cognitive efficiency are offered by good graphical displays.




  • Substituting Visual Operators: Graphical displays often allow users to substitute less demanding visual operators in place of more complex logical operators in place of more complex logical operators. Visual operators (e.g., distance and color comparisons, spatial coincidence judgements) can often give users the same information as more complex non-visual operators.




  • Reducing Search: Graphical displays often arrange information in such a way as to reduce the number of items the user must look at in order to find something useful, or to group information required to draw a particular inference into one spatial locality. Graphical techniques like shading and spatial arrangement can help guide the eye to relevant information or past irrelevant information.






A lot of designers especially today get overshadowed by creativity and can get too far from the initial goal of communicating a goal. Here's a passage from Visual Design Principles for Usable Interfaces (Watzman, Suzanne) that I think is very relevant:



Defining Visual Design. Visual design is not merely a series of subjective choices based on favorite colors or trendy typefaces--at best a cosmetic afterthought considered if there is enough time and money. Good visual design is the tangible representation of product goals. It is concerned with the "look," the method, and the style in which the information is presented. It should be the result of a thoughtful, well-considered process, not merely a decorative afterthought.


Applying the appropriate visual/experience design principles and tools while incorporating the user perspective (information design) enhances the value, perception, and usefulness of products. It is the best combination of project goals, the user perspective, and informed decision making.



Design is in direct relationship with the economy. When we design for Engineering it is very easy to see how the design solution must meet certain economic goals. In architecture and graphic design this is often not the case. They can become ornate and saturated, especially when the economy is good. The budget is there. When the economy is bad then things get simplified, mass produced, reusable, templates and frameworks --- all of it. There are design solutions that are possible within these parameters and they reduce the overall cost of goods. When times are good, or you get lucky enough to land a client with the money to spend then its easier to justify new paradigms and reasons.


Reducing Search: Where the Principles of Design come in



If the goal is to communicate an idea then to best do this, we as designers, must have some clue how people (unless you're designing for other species) perceive the world around us.


Top-Down Processing. Widely seen as the bulk of our processing capabilities is that we start at the larger entities before working our way down into the details. In this way our expectations affect our perceptions. For examle you probably filled in the letter P just now, because your brain expected it to be there. There are a number of tests you can look at including, The Hollow Head, which tricks your brain into seeing what isn't there. It does this because of top-down processing giving us expectations about what SHOULD be there, rather than what IS there. (An immediate example of this in the traditional realm of Graphic Design would be the cover of Invisible Monsters by Chuck Palahniuk:


enter image description here


Bottom-up Processing. Also called data-driven processing, is when you have no expectations. You have to start small and work to fill in holes until you find an expectation.


Additional Study: Khan Academy Lesson: Bottom-up vs Top-down Processing


As a Graphic Designer you can think of this as the "aha" moment. If the majority of your intended audience can immediately identify the whole then they use almost all Top-Down Processing. This is a key ingredient for a successful design. It requires less searching from one spot to another in the hopes of figuring out what is going on.


I'm going to end this here, at least for now. At this point you can get into the more technical stuff like the Gestalt principles that Dominic has begun to discuss.



I realize some of this stuff seems fairly complex, particularly for new designers to grasp. Over the next few days I'm going to add images in this section but wanted to at least get some basic stuff in writing to help people out.


First Iteration of an Advertisement or Website:



On your first iteration of an advertisement pretend you put in a picture of your product in use. Pretend for now its a water bottle being drunk by someone on a crowded basketball court.


You look at it and think, wow this is a great shot of our product! You show your coworkers and they think, wow our designer did a great job showing our product! You show the rest of the world though and you know what they're going to think? What's the product?


They'll have to search the page for clues.


Second Iteration


To begin fixing this you might think, how can I make this clear. People should be able to quickly scan the ad and know exactly what it means. It should be as much top-down processing as possible.


So perhaps the first step is adding a logo. Put a logo on the bottom right and the logo is visible on the water bottle. That's a good clue. Is it enough though? Probably not.


Third Iteration


You work on the copy and add some large text, "Always cold water! The world's first water bottle with solar panels that can keep you hydrated on the hottest days!"


Alright, we're making progress. Now someone sees a photo, identifies the logo, and discovers from the copy that we're talking about some sort of water bottle.


Fourth Iteration



Circle the water bottle. Darken everything but the water bottle. Oversaturate it. Do something, anything, to make it pop! Now we're doing graphic design. Now there's almost no searching left. Without any text someone could look at your piece and immediately know to focus on the bottle. Maybe you differentiate the entire person with the bottle well thats okay, you still have the text to further support it.


Final Iteration


The idea is finding a balance. How many iterations it takes is up to you. But with any design of anything you have to either really look at it as though its your first time or get others to test it for you. Once someone knows the product then they have expectations. They're looking for your product already. You want to make your design communicate what that product is as well as you can allowing end-users to understand, and remember it, with as little bottom-up processing as possible. The less they have to scan before understanding, the better.


(I'll redo this example with pictures over the next few days)


Additional Reading:




Here is a great paper on Top-Down Processing that Transitions into those very principles: What's up in top-down processing? by Cavanagh, Patrick.


Here's a wonderful article that came out in The Atlantic today (May 5, 2014) which stays on fairly abstract terms non-designers can understand but does clearly state: Things You Cannot Unsee (And What That Says About Your Brain)






In short: what you know influences what you see.



Saturday, December 22, 2018

adobe photoshop - What makes a design professional?



Can anyone define why something might not look "professional"?


What differentiates between professional/unprofessional designs?


I have clients who have said my design does not look very professional. I followed all the things to make it professional - maybe I don't know enough about design? I have seen lots of "professional" design templates that look easy & similar to mine. Most of the time, when I don't have any way to go, I follow these template designs - but when I finish I get feedback that "This doesn't look professional". This doesn't help me though. Does anyone here have real-world help/experience/suggestions would help me regarding looks, font, style... everything. Please give me a way!


In short:
What makes a design professional?



Answer



I made this another answer since this is to comment on your design:


You tell us that you can easily recreate professional templates. In fact i doubt it. You really have to learn a lot about webdesign. Seriously far to go, but you are eager to learn and therefor i made this mockup to explain some things. This is not to bash you, seriously no offence meant, i am just being honest.


enter image description here


The basic story is that it is lacking alignment and depth... alot of depth.



I will also include one of my designs i am currently working on width a grid overlay so you can see what i mean. It is far from done, but you will get my point. Please do not use parts of the design i am working on since they are copyrighted.


enter image description here


Take a look at how i create depth with smooth gradients, textures and shadows. Besides that, take a look at how it is spaced.


Edit: Just so you know, i editted the width for copyrighting. So this isnt in real aspect ratio.


Hope this helps you.


color - Identifying HTML colour codes placed in one pixel




  1. How many colours at once can one pixel contain?




  2. Is there a tool that can represent this pixel in a form of HTML colour codes? (And if there are many colours in this pixel, can this tool show the order of how colours are distributed all over the pixel - it's like 4 colours in a pixel and it says that colour #NNNNNN is placed first on the left, then second is on the right and so on - or in any other explanation)*







Friday, December 21, 2018

usability - Is there any research or data on horizontal vs. vertical navigational menus?


I've seen many sites using both horizontal (top) navigation, vertical (left) navigation, and both across web sites for a long time. My understanding is that they're both conventions, but I would assume there must be some data out there supporting one route over the other.


My question is: are any studies or data for or against horizontal or vertical navigation (as suggested above) with regards to primary navigation (specifically on a smaller site or web app).


I've read some interesting things that are flipping me back and forth between liking horizontal more than vertical and vice versa. For example if you look at Jacob Nielsen's post on Horizontal Attention Leans Left you get the feeling that more important content should be on the left -- but you could take that as it being more important for the navigation (the user's escape routes) to be in that valuable space.



Answer



I know two studies that cover this subject:




  1. Kalbach, J. and Bosenick. T. (2003). Web page layout: A comparison between left and right-justified navigation menus. Journal of Digital Information, 4(1).





  2. Kingsburg, J.R. and Andre, A.D. (2004). A comparison of three-level web menus: Navigation structures. Proceedings of the Human Factors and Ergonomics Society Annual Meeting.




You can find a summary of both studies in the article Navigation: Left is Best, by Dr. Bob Bailey, published in usability.gov in 2006.


poetry - What's next when it comes to poems?


What are the steps that one needs to follow to become a successful poet?


Well in my case, I write poems but don't have a wide audience for the feedback. So in this case what should I do? Should I keep on writing my poems and show it to the stiver of audience I do have on Facebook and YouTube or should I be moving on to the next level? If so, what's the next level and how to proceed towards it? All in all I would like a layout of a poet's career.



Answer




Poets don't tend to have "careers" in terms of remunerative employment. Even great poets have tended to be either independently wealthy or otherwise employed (T.S. Eliot famously worked at a bank, and Maya Angelou made her name writing autobiography before she was ever known as a poet). You can be a figure of respect, and influence, with devoted fans, in the poetry world, and still never make a dime. Given that, your career needs to be approached as a question of how best to ensure your work reaches an audience, rather than in terms of more prosaic concerns. Freed from the fantasy of financial gain, you could always seek out creative ways to get your work "out there." For example, you could volunteer to write "occasional" poetry to mark special events, or in honor of a school or a non-profit organization, or a person. You could also become a lyricist or even a rapper.


Your real best bet, however, is to identify a community of people who enjoy the kind of poetry you do, and find a way to connect with them. For instance, many cities have regular "coffeehouse" events where people read either traditional or slam-style poetry. Take along a self-published chapbook or collection, and you'll be able to make personal sales to people who enjoyed your work. It this goes well, you might be able to start touring around, doing higher profile events locally and in other cities, or even booking your own solo readings at libraries and bookstores.


If you don't have any local community of "live" poets or venues, you might think about organizing your own. The local poets with the highest profile (in my city) are always tirelessly working to build audiences, not just for themselves, but for all poets. Poetry is arguably primarily a performance art, so you'll be showcasing your work better if you find a place to declaim it, rather than just publish it. If that doesn't work for you, there's always the internet, but you'll be one small fish swimming in a great big pool of other aspiring poets. So even there you'll need to either find a community or create one.


website design - What is the purpose of using a very dark color for text instead of a pure black?


I have seen that some web designs implement an almost black font color (hex #001c00) in their designs instead of a pure black color (hex #000).


Does the design actually benefit from this or is this practically the same as using a black color?


I am a hobbyist web designer and developer and can't seem to grasp the difference.



Answer



I always prefer a very dark grey to pure #000. The choice might look personal, but here's the theory behind it:


There are very little 100% black things in nature. All black objects you see have some for of light reflected on them, shadows are never completely black.


When you #000 in a design, it overpowers the other colors. It attracts too much attention, because it is not natural. Of course a website is not natural, but the brain reacts in a similar way nonetheless.



That's why lots of designers go for dark grey instead. You can do a search by color in sites like Dribbble. The difference is small, but noticeable: Dark grey is more frequent and looks better in lots of cases.


For example: Designing in the Dark: 10 Dark Sites and Their Color Schemes (none of them, I think, use #000 as part of their palette)


Thursday, December 20, 2018

When logging out of a website that authenticates with Facebook, should the user be logged out of Facebook as well?


I'm working on a website that integrates the Facebook login API. When a user clicks the logout button for the website, I log them out of the website's session. The question is if I should be calling the Facebook logout method to log the user out of their Facebook session as well.


Based on the "Keep me logged in" checkbox on the Facebook login dialog, I would assume that we should be logging them out of Facebook too.


I've seen on sites like Quora, Groupon and Vimeo that if a user logs in with Facebook to the site and then logs out, their Facebook session is still valid.



Answer




I seriously doubt that also logging out of Facebook is the expected behavior in the most common scenarios. However, there is a worst-case scenario where logging them out might be the civilized thing to do on their behalf.


The most nuanced approach would be to leave them in whatever state they were in when they came to your site: so if they were signed in to FB already you leave them signed in when they leave. If they had to authenticate to Facebook, you sign them out when they're done, respecting the value of the "Keep me signed in" checkbox.


Scenario 1 (most common): The user comes to your site. They're using their computer or device. (you have no way to know this.) They're already signed in to Facebook. They use your site and leave. In this case it would be really annoying to sign them out of Facebook.


Scenario 2 (worst-case): The user comes to your site. They're using a computer at a hotel business center or in a webcafe. They have to sign in to Facebook to sign in to your site. They use your site. They forget that Facebook was involved at all. (Count on this.) They leave your site. In this case it would be very nice to sign them out of Facebook.


Scenario 3 (common with an annoying downside): They're on a mobile browser. Don't sign them out of Facebook. Signing in on mobile is very tedious and even more error-prone than on a computer with a proper keyboard. Mobile devices are very personal and it's likely they want to remain signed in on Facebook.


optimization - Maximum Sharpe portfolio (no short selling restrictions)


Suppose we have $n$ assets whose expected return vector is $r$ and is positive, and whose covariance matrix is $\Sigma$. Is there a closed form or quasi closed form (like the eigenvector of a matrix etc) solution to the portfolio weights vector $w$ which maximises the Sharpe ratio $w^T r/\sqrt{w^T \Sigma w}$? (Assume no restriction on short selling.)


If in general its not possible, does a closed form solution exists for low dimensional cases like $n=2,3$? I remember being taught a closed form solution for $n=2$ in the class. The expression is a bit complicated and unfortunately isn't accompanied with a proof.


I tried differentiating wrt $w$ but the gradient is a mess. I don't think we can get anything useful out of it.




Per the comment, the linked source claims that the maximiser is in the direction of $\Sigma^{-1}r$. Could someone explain or suggest otherwise? Thanks.

Answer



There are two cases, where short sales are allowed: With riskless lending and borrowing and without. As mentioned in the comments, you just have to solve a linear system.





With riskless lending and borrowing


The existence of a riskless lending and borrowing rate $r_f$ implies that there is a single portfolio of risky assets, that is preferred to all other portfolios. You want to maximize the function


$$\theta = \frac{\bar{R}_P - R_f}{\sigma_p}$$


subject to the constraint $\sum_{i=1}^N X_i = 1$.


$\bar{R}_P$ denotes the average portfolio return of $N$ assets $i$ with weights $X_i$ and $\sigma_P$ is the standard deviation of portfolio returns. From the definition of portfolio return, $R_f = 1 \cdot R_f = \left( \sum_{i=1}^N X_i \right) \cdot R_f = \sum_{i=1}^N (X_iR_f)$, and their standard deviation, you get


$$\theta = \frac{\sum_{i=1}^N X_i(\bar{R}_i - R_f)}{\left[ \sum_{i=1}^N (X_i^2 \sigma_i^2) + \sum_{i=1}^N \sum_{\substack{j=1 \\ j\neq i}}^N X_iX_j\sigma_{ij} \right]^{\frac{1}{2}}}$$ where $\sigma{ij}$ is the covariance of asset returns $r_i$ and $r_j$.


It is a simple maximization problem, you take the derivative with respect to each variable and set it equal to zero. You get a system of equations:



  1. $\frac{d\theta}{dX_1}=0$


  2. $\frac{d\theta}{dX_2}=0$

  3. $\frac{d\theta}{dX_i}=0$

  4. ...


In general: $$\frac{d\theta}{dX_i}=-(\lambda X_1\sigma_{1i}+\lambda X_2\sigma_{2i}+ ... + \lambda X_i\sigma_{i}^2+ ...+\lambda X_{N-1}\sigma_{N-1,i}+\lambda X_{N}\sigma_{Ni})+\bar{R}_i - R_f = 0$$


with


$$\lambda = \frac{\sum_{i=1}^N X_i(\bar{R}_i - R_f)}{ \sum_{i=1}^N (X_i^2 \sigma_i^2) + \sum_{i=1}^N \sum_{\substack{j=1 \\ j\neq i}}^N X_iX_j\sigma_{ij} }$$


After defining a new variable $Z_k = \lambda X_k$, the formulation simplifies to the system (lets call it A):


$$\bar{R}_1 - R_f = Z_1\sigma_1^2 + Z_2 \sigma_{12}+Z_3 \sigma_{13}+Z_N \sigma_{1N}$$ $$\bar{R}_2 - R_f = Z_1\sigma_{12} + Z_2 \sigma_2^2+Z_3 \sigma_{23}+Z_N \sigma_{2N}$$ $$...$$ $$\bar{R}_N - R_f = Z_1\sigma_{1N} + Z_2 \sigma_{2N}+Z_3 \sigma_{3N}+Z_N \sigma_N^2$$


The $Z_N$ are proportional to the optimum amount to invest in each security. First, solve the above system for $Z_N$, then the optimum weight $X_k$ for each asset $k$ is



$$X_k = \frac{Z_k}{\sum_{i=1}^N Z_i}$$


Without riskless lending and borrowing


If a riskless rate $R_f$ is not available, the solution above has to be modified. Assume that $R_f$ exists and find the optimum portfolio with the method above. Then assume a different $R_f$ and find the optimum portfolio that corresponds to this slightly changed riskless rate. Continue changing the assumed rate until the full efficient frontier is determined.


Consider again the linear system A. However, we do not have to substitute in a particular value of $R_f$. We can simply leave $R_f$ as a general parameter and solve for $Z_k$ in terms of $R_f$. This results in a solution of the form


$$Z_k = C_{0k} + C_{1k}R_f$$


where $C_{0k}$ and $C_{1k}$ are constants. They have a different value for each asset $k$, but that value does not change with changes in $R_f$. Once the $Z_k$ are determined as functions of $R_f$, we could vary $R_f$ to determine the amount to invest in each security at various points along the efficient frontier.




Additional remark


Lintner(1965) has an alternative definition of short sales which is more realistic. He assumes correctly that when an investor sells stock short, cash is not received but rather is held as collateral. Furthermore, the investor must put up an additional amount of cash equal to the amount of stock he or she sells short. In summary, the constrain here becomes $\sum_{i=1}^N \left| X_i \right| = 1$.





Reference


Elton/Gruber/Brown/Götzmann (2014), Modern Portfolio Theory and Investment Analysis, ed. 9, John Wiley & Sons.


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...