Tuesday, December 31, 2019

typefaces - Webfont alternatives to Gotham


The Brand Guidelines have specified the use of Gotham and Arial as the typeface, and I can see that in the past people have had various experiences with using Gotham on the web.


Instead of using Arial, which I feel is not really a good alternative to Gotham because it doesn't have the polished finish, it seems like Proxima Nova is one of the best options, but I might not have considered other options.


My comparisons:



  • Gotham vs. Proxima Nova (capital M and the number 3 are most different)

  • Gotham vs. Proxima Sans (capital M and the number 3 are most different)

  • Proxima Nova is nearly identical to Proxima Sans


  • Gotham vs. Arimo (captial Q, M and the number 1, 3 are most different0

  • Gotham vs. Montserrat (captial Q, M and the number 1 are the most different)


I would conclude that Proxima Sans and Montserrat could be suitable replacements, with Montserrat being a Google Font which should be web safe.


What are some popular webfonts that have an open license and can be used as an alternative to Gotham?




How to make a multi-color gradient in photoshop?


**enter image description here**


Hello, I was wondering what it takes to make this blurred and blended type of multi colored gradient in photoshop? Any help is greatly appreciated!



Answer



In Photoshop:




  • Create a new document

  • Create a shape

  • Go to FX


enter image description here



  • Gradient Overlay


enter image description here




  • Click the the current gradient


enter image description here



  • Create a new gradient


enter image description here



  • Add color to the gradient path and you might want to use the color picker to find the colors



enter image description here



  • Change the style to linear


enter image description here


Play around with the colors:


enter image description here


adobe photoshop - How can I combine multiple PDF files into one?


I have made my CV using Photoshop CS5.1 (3 separate files) and need to convert it to a single PDF file. I've done it before using a free download but can't remember what it was...does anybody know? Or is there another way this can be done?





Monday, December 30, 2019

Naive question: how do factor models inform portfolio construction?


I have read plenty on the topic of factor modelling, but, in the end, after one has decided upon the factors to include in a model, how do all the Betas how tell one how to weigh each asset in a portfolio to maximize return?


For example: as a portfolio manager, I have $n$ (let's say 10) securities in the universe of securities that I can invest in, $k$ (let's say 20) factors that explain those securities, and the following factor model for each security: $$r_i = \beta_0 + \beta_1*factor_{i,1} + \beta_2*factor_{i,2} + \ldots + \beta_k*{factor}_{i,k} + \epsilon$$


After having regressed the following factor model for each asset, for the current period $i$, how should one construct a portfolio with weightings for each asset? I imagine that the $\beta$'s are helpful in making this decision?



Thank you in advance.




technique - How to transmit feelings in a technical book writing?


For example, in Skype conversations you use emoticons. I might use (headbang) after a phrase to express frustration, or I can have a (facepalm) moment, or I can write a joke and add (rofl), etc.


But how do you do this in a technical book (not an animated book)? Not all people might understand what (rofl) stands for. So what alternatives are there, or what techniques to use to express feelings or emotions in a technical book (not one with characters where you might make the characters behave in a certain way that express the feeling/emotions)?



Just an example: a project management book or something. Where you might describe a techniques that drives everyone crazy and never gives good results, but somehow doesn't stop people for using it again and again. For that I might use (headbang).




adobe photoshop - Why is the paint brush painting in a particular layer style?


I was trying to clean up the bottom of this bitmap bookmark by replacing blurry (i.e. Between black and the main grey color) pixels with the main grey color of the bokmarks.



I selected paint brush, then used the eye dropper tool to select the main grey color. When I subsequently tried to change the foreground color to black or any other color, however, the brush simply continued to paint in the grey color!


Eventually I figured out it is because the eye dropper must have picked up the layer style rather than the actual color, and so I was painting in the layer style. When I "cleared styles," however, all of the grey in this image disappeared and was replaced by whatever I had as the foreground color (the brush would then also finally paint in that color, but at this cost described...)


Could someone please explain why this happens, and how it might be possible to simply paint on to this layer in different colors without changing the existing layer style?


Thank you in advance.


enter image description here



Answer



Layer styles alter the entire layer.


If you do not want layer styles applied while painting, paint on a new layer without any layer styles applied to the layer.


EDIT:


Layers have internal structures. When you create an element such as type, a shape, vector object, or a brush stroke you start at the level closes to the canvas. Lets call this the painting area. When you add a Layer Style it gets stacked on top of or below the painting area in a predetermined location. The order in which the layer styles are listed in the Layer Style dialog refers to the order they are stacked on top of one another.



layer structure


The structure of layers with layer styles is somewhat complex and can be difficult to grasp unless you study it a bit.


Some Layer Styles will always fall below the painting area, while other Layer Styles will always be *above** the painting area. There is no way to add pixel data above some live layer styles on a single layer. With some Layer Styles you are always painting underneath the layer style. You can not change the stacking order of live Layer Styles.


The "Overlay" Layer Styles are designed to cover all pixel data on the painting level. Therefore, you can't use an overlay layer style and ask it to ignore a portion of the painting level. It sees the entire level. The exception is a Pattern or Gradient Overly which contains transparency, or any Layer Style where opacity has been reduced.


If you need different colored pixel data which is not effected by the layer styles, you need to add a new layer. The structure you are seeking is simply not possible on a single layer.


An alternative, which may or may not work for your given circumstance, is to right-click (Windows) or Control-click (Macintosh) on the Layer Style icon to the right of the layer name in the Layers Panel and choose "Create Layers":


Create Layers


This will split the layer styles into raster layers and their stacking order can then be altered. But be aware, this removed the dynamic ability to alter the Layer Styles any further. When you Create layers you are doing just that and each layer is then a standard pixel-based layer.


typography - Will text laid out on an image in Photoshop, when printed look pixelated? Or sharp enough?


The title really says it all. I want to design a poster for my home. But here's my question, if I lay out the text in photoshop, save it and then print it - will the text look pixelated? Or sharp enough like how in posters text normally does?



Answer



If you're sending it to be printed, then save the file as a Photoshop PDF. All your vector information, including text, will remain vector.


information architecture - Designing for the fold


What is your advice for designing for 'the fold'? Is this still a concern? Is the concern that people won't scroll? Can't you use visual cues to help users understand that there's more content below the fold? Obviously you want to have the most important information or what you think users are looking for up top.



Answer



To quote one of Jakob Nielson's studies on scrolling behavior:



Today, users will scroll. However, you shouldn't ignore the fold and create endless pages for two reasons:



  • Long pages continue to be problematic because of users' limited attention span. People prefer sites that get to the point and let them get things done quickly. Besides the basic reluctance to read more words, scrolling is extra work.


  • The real estate above the fold is more valuable than stuff below the
    fold for attracting and keeping users' attention.


So, yes, you can put information below the fold rather than limit yourself to bite-sized pages.



To add to what Nielson wrote, lead with your most important information, your best offer. Keep your primary call to action above the fold. Attention spans are short on the web and it's best to make your point and make it sooner rather than later.


If you want users to keep reading, make it easy for them to do so. Break up your pages with headings, graphics, and bullet points. Make your key points easy to see. Some users may just scan, but make sure they are able get everything they need from your page by reading your headlines, pull quotes, and bolded text, with the option of going more in-depth by reading every word. It also helps to put some content on the fold so that a user can see part of it, but will have to scroll down to see the rest.


Where is the fold? It's all over and with the increased usage of mobile devices, it will only grow more diverse. You'll need to very carefully consider your target audience and make adjustments based on your own analytics.


word choice - How much swearing is TOO much? (And how much is not enough?)


I've noticed that some of the most successful writers refrain from using profanity, such as Stephanie Meyer and Norman Mailer. Are readers turned off by swearing in books?


More importantly, is it wrong to use profanity? Is it bad writing?


Should I replace my shits with "sh*ts"?



Answer



I think that technically the only reason not to use profanity in your writing when you want it is if censorship will prevent you from reaching your target audience.



For example, you want tweens to read your book but their fucking parents won't let them because of the fucking swearing.


Swearing is like salt on food though, too much or on the wrong dishes can just make you seem like you don't know what you're doing. If there's too much salt then you can get tired of the taste.


There's a book called Watch Your F*cking Language: How To Swear Effectively. I haven't read it myself but I've been wanting to pick it up.


Don't try to pander to people's tastes.


Your writing will appeal as a whole to your audience. If you cut out the swearing for the sake of the few who don't like swearing, then you may degrade the quality of expression of your work. At the same time, removing the swearing does not necessarily please the people who would already dislike your work anyway.


How to create click and stop GIFs for Facebook?



I have seen GIFs on Facebook which will freeze on the mouse click. Normally these kinds of GIF are used to run a contest in social media. Right now I am not getting any social media links for reference but here is the GIF file uploaded in Giphy: http://gph.is/2hWCUaX (I am assuming this GIF is used for some contest where we need to freeze the GIF when aeroplanes are right inside the white shape).


Could anybody explain to me how to create Click & Stop GIFs?



Answer



As mentioned, GIFs cannot be paused or scrubbed through because they are just images. There are some projects that fake it like giffer, which replaces the GIF with a div with the first frame of the GIF, that then gets replaced by the original GIF when the div is clicked.


However, in recent years some applications have been converting GIFs into video files (mp4 and WebM formats usually) in order to save massively on file size (up to 95%) and gain some additional functionality like pausing and scrubbing through it. This format is called GIFV (.gifv) by Imgur. It seems that Facebook is now doing the same thing.


One valid approach for you might be to upload your GIFs to Imgur and link to their .gifv link. Another would be to just use the mp4 and WebM video formats to begin with (this is what I did with my personal page).


interest rates - Interpolating probabilities of default


I have a table of cumulative probabilities of default of industrial bonds, in time and credit rating. It is similar to S&P whitepaper here. Basically, it looks like this (sample numbers):


Years | AAA   | AA    | A    | ... | C
1 | 0.01% | 0.04% | 0.09 | ...
...

30 | 1% | 5% | 8% | ...

This data has gaps both in time and in credit rating. Is there any standard methodology on how to do such interpolations/extrapolations or perhaps a paper/book I can read on the subject?


On a related note, what if the numbers in the table are interest rates for the corresponding bonds - is there a methodology for that?


Thank you very much.


UPDATE Related Question



Answer



I believe that your problem can be formulated as:


Find PD matrix that is as close as possible to a given PD matrix (result of some previous calibration, or the matrix computed using average hazard rate, or any other "target", or the penalty on non-smoothness) subject to the following constraints:




  1. The values that are given must be matched exactly

  2. Monotonicity constraints (in both time and rating) must be satisfied, and so are 0 and 1 bounds.


This fits the definition of quadratic programming. Matlab has got it [implemented].2


Quadratic programming is a method that allows you to find the best possible answer. However, if there are not too many gaps, and being close to the "target" is not essential, you can interpolate/extrapolate them manually, subject to constraints


Is there no such thing as OCR-B font in bold?


I have been looking for a good monospace font in order to meet the criteria of a client.


One I found that I think has suitable qualities is OCR-B.



However, as near as I can tell, it only comes in "regular" form, no bold or italics.


Is this because its roots as an optically recognizable font precluded variants?


Or is it just that my Google-fu is weak and I simply haven't found it (I think I can claim to have met a reasonable level of requirement of having searched before asking).



Answer



Pretty sure you're right with "its roots as an optically recognizable font precluded variants".


You should be able to able to apply faux-bold in most applications, though. While this is normally very bad practice, I wonder if it might produce acceptable results with a font this basic?


Sunday, December 29, 2019

Can I self-publish on a reputable publishing platform, and how much would it cost?


With the barrier to having a publisher sign a new author seemingly high, especially without prior success or experience, are there any good author-funded alternatives out there to the repeated mailing of manuscripts out to additional publishing houses after facing rejection?


As a businessman, especially since I have a bit of savings, and since I am familiar with the practice of procuring investors for other types of ventures, is there a way I could put up $10k of my own money with $25k from other sources to help grease the wheels of this process? If the book doesn't become popular, I understand the risk, but I'm willing to face that possibility.



Since someone will no doubt bring it up -- no, I don't mean some kind of random run on a POD website like Lulu or whatever. I'm asking about a reputable company taking on the mechanics of getting my book into Borders, and/or wherever else possible.



Answer



What you're thinking of is vanity publishing. A vanity publishing house is one that will publish your book, but you pay all of the costs. You pay for the marketing, the editing, the cover art, etc. Basically all they do is print the book and put it in stores for you.


And to be honest, if you go this route, you're going to be laughed at in the publishing world. Money is supposed to flow to the author, not the other way around. If you then decide to go into traditional publishing, they most likely won't count that book as a prior publishing credit, since anyone with a couple thousand dollars can have their books printed.


If your book isn't good, a traditional publisher isn't going to take it on no matter how much money you wave at them. Not only does the publisher need to be able to sell the book, but they need to maintain their reputation. If they start publishing poor quality manuscripts, they'll get less submissions and their sales will drop as well. So unless you plan on funding them with quite a bit of money, they're not going to blink.


filtering - Single search box for different types of searched criteria


I have a scenario where users can search for a particular hotel and add it to their private list. Up until now the search was performed on the hotel name, but now there is a request to also search hotels by ID. This is how the UI looks now:


enter image description here


To keep things simple, I was considering using the same searchbox and labeling it "Search by name or id", which would return the following results:


enter image description here


Now the thing is, in the above example if a user types in 26A5C they will normally get a list with results that match one if these cases:



  1. Have the ID containing the 26A5C sequence

  2. Have the "26A5C" string in the hotel name (E.g. "Bellisimo 26A5C Resort")



But if the user types in "26A5C Bella" then what would they expect to see? Would they expect to see:



  1. All hotels with an ID starting with 26A5C and a name starting with "Bella"?

  2. All hotels containing the "26A5C" and "Bella" strings in their name?

  3. Both of the above (see next wireframe)


enter image description here


From a technical point of view it's harder for the development team to implement the single searchbox feature. It would be easier for them to implement two separate searchboxes with separate result lists: one for hotel IDs and one for hotel names. So the options I have now are the following:



  1. Single searchbox for both hotel name and ID (harder to implement, better UX)


  2. Two searchboxes: one for hotel ID and one for hotel name (easier to implement, cluttered UI)

  3. Single searchbox with two radio controls for the user to pick the search type: hotel ID or name (less cleaner UI than #2 but same development time as #2, but an extra click for the user)


Given the situation described above, what would you think is the best approach? Are there any other options besides those I mentioned? Thanks for the help!



Answer



In my opinion, the obvious answer here from a UX perspective is that the box 'just works'.. no radio button, no double search field. As you stated, it then becomes a challenge of technical implementation.. a few notes on that.


I'm going to assume that one of your goals for this search is that its fast.


With a fast query, you can give the user results as they are typing. This visual feedback to the user should cut down on some of the ambiguity cases.


Search services that operate quickly precompute their results. There is a data structure called a 'trie' which basically precomputes 'If the user typed 'A' for the first character, give them these.. Aardvark Hotel, Adagio, Allawishes Underwater Hotel, etc'. Then as the user types the second charectar after the 'A', you search ONLY inside of the set which was already returned (since it contains all possible combinations of A followed by A, A followed by B, A followed by C, etc. Therefore, additional searches dont require an additional request to the server.


What I'm getting at, is that your interface should have access to a local subset of the data and allow to locally search through that data, OR have access to the entire dataset and do the searching entirely locally.



For a normal website, a server would periodically compute this file (or set of files). A user who accesses the page would dynamically load the file(s) and be ready to instantaneously show any result. As the user types more than 2 or 3 characters, the search for results would be done locally on that users computer, rather than on the server and having the user have to wait for the results.


ADDITIONAL NOTES:


Also keep in mind, that as soon as the user sees what they are looking for, they are going to stop typing and click it... so that partially makes your 'But if the user types in "26A5C Bella"' a non issue


you would have to 'index' each of the hotels both by their name, and id when you created the local search data structure


if this is a consumer facing service, PLEASE hide the ids in the result box UNLESS the user typed an id.. it will just look nicer.


as I subtly stated, traditionally you dont try to do a result lookup as the user is typing UNTIL they have typed more than 2 or 3 charecters.. this cuts down on the data being analyzed.


precomputing these data files is usually done by a 'cron' job on a server OR when each request for the file comes in, the server gets the file, checks when it was built, if it was built too long ago (last week for example), then you hand the user back the file existing file, kill the connection, and recompute the file and replace it with this new version so that its kept up to date.


Here is some info on tries.. that talk about performance.. your performance would be be based upon your data, and programming languages you guys use. If this looks technical, its not really, just remember that the concept is not different then when I search A you give me back this chunk of results, when I search B you give me back this other chunk of results. http://ejohn.org/blog/javascript-trie-performance-analysis/ http://en.wikipedia.org/wiki/Trie


terminology - What is a "toast notification"?


Microsoft mentions the toast as a visual element in the package manifest for Metro-style apps with the attribute ToastCapable="true".


What does this mean?



Answer



A Toast is a non modal, unobtrusive window element used to display brief, auto-expiring windows of information to a user. Android OS makes relatively heavy use of them.


Here's an example of a Google Chrome toast notification on Mac OS X:



enter image description here


A list of descriptions of Toast windows on multiple platforms:



feedback - Help with expert reviews


I am reviewing a client website. Usually I will find plenty wrong and will be able to highlight issues and recommend solutions. The problem with this particular project is that the website is actually very good and has nothing much wrong with it.


How should I structure* my report? What recommendations can I make? Have you come across a similar problem when you review websites?


*My reports are usually based on a 12 section evaluation adapted from Nielsen's usability heuristics.



Answer



The overview is the hardest part to write because you need to have done all the work of the other parts to write it. In the overview you should be up front about saying that it is a good site, and be brief but specific about what makes it good - so that it does not come over as flannel. Being specific also makes a statement about the work you have done in assessing the site, right from the start.



  • Be sure you have indeed been systematic in looking at the site. That's the key thing that differentiates what you've done from casual clicking around. You want to have checked out recovery with lost-password, delivery to addresses other than the cardholder address, duplicate submission of the same order, overseas orders, know the strengths and weaknesses of any built-in search (in as far as such features are relevant to this site).


  • Easily overlooked - do some assessment of what happens if a service the site relies on is slow or down. Could easily happen as the site gains traction. You may need to talk with the site developers about this as you may not be able to assess this just from visiting the site. Does the site degrade gracefully and communicate clearly with the user?


You asked:



"How should I structure my report?"



If you have written terms of reference (write some for future contracts if you haven't) you can base the structure on that.


If not, start with your overview, even if you have to write it last, and then use chronology (roughly the order of development) as your organizing principle. Likely a review of the ease of placing an order will come earlier in your report than review of special-offer screens or overall site structure.



"What recommendations can I make?"




These will come out of the individual review sections. Formal user testing, and proceeding towards launch if there are no glaring problems are perfectly good recommendations. You don't need to clutter your report with unnecessary recommendations.


If you do find some problems, be sure to end your recommendations with some statement of something that is genuinely good about the site.


Are Flat Buttons Unusable?


What is your experience with the usability of flat buttons? The common critique against those buttons is that people can't distinguish them, and they only look like headlines with a background. But if the rest of the UI also is very flat, wouldn't that help the users to understand what the buttons look like? Gmail, for example, has a very flat UI.




modern portfolio theory - What is a "coherent" risk measure?


What is a coherent risk measure, and why do we care? Can you give a simple example of a coherent risk measure as opposed to a non-coherent one, and the problems that a coherent measure addresses in portfolio choice?




Answer



I'm just providing a global answer to the question, as I think it can be interesting for some beginners in quant finance.


The properties given by TheBridge:


Normalize


$\rho (\emptyset)=0$


This means you have no risk in taking no position.


Sub-addiitivity


$\rho(A_1+A_2) \leq \rho(A_1)+\rho(A_2)$


Having a position in two different can only decrease the risk of the portfolio (diversification)


Positive homogeneity



$\rho(\lambda A) = \lambda \rho(A)$


Doubling a position in an asset A doubles your risk.


And finally,


Translation invariance


$\rho(A + x) = \rho(A)-x$


That is, adding cash to a portfolio only diminishes the risk.


So a risk-measure is said to be coherent if and only if it has all these properties.


Note that this is just a convention, but it is motivated by the fact that all these properties are the ones an investor expects to hold for a risk measure.


Finally, notice that neither VaR nor Var are coherent risk measures, wherease the Expected Shortfall is.


validation - Mark input in forms as required even if all input is mandatory?


I looked up many questions and answers here regarding labeling mandatory input fields. The de facto standard is an asterisk * to mark input as required. Also the common approach is to mark the required input as such.


My questions are:



  • If all input in a form is required (or only 1-2 fields are optional[1]) - does it still make sense sense to mark all of them as required?

  • Is a caption like '* = mandatory input' still needed then or do people know what the asterisk means (balance b/w helpful information and added visual noise by the caption)?


[1] Just highlight the optional ones as such?



Answer



If no fields are optional, it would make more sense to have a message on the page saying all fields are mandatory.



If a few are optional, it would make sense to mark them as optional. I would use something different than an asterisk for this. The word "optional" in italics next to the form element is typical.


To be safe, you should still include a message somewhere explaining that * denotes a mandatory field. While it's a pretty common usage, it's not universal.


data - How to update an exponential moving average with missing values?


Say you have an Exponential Moving Average being continuously updated over a time series using 1-second-long time periods. What should happen if there is no value for the next second, e.g. there were no price updates? Should the function decay in some way since there are no new values? Is there a correct or accepted way of handling this case?



Answer



You can either




  • reuse the last computed EMA, or

  • fill-forward the previous period's sample data and recompute the EMA.


I generally prefer the second option, which should cause a decay. Only go for the first option if your application won't change its logic based on missing data.


risk neutral measure - Drift rate vs. Riskless rate in the Black-Scholes model



I'm teaching an applied math class this summer and I want to take a short detour into finance (not my specialty at all); specifically the Black-Scholes model of stock movements. I want my students to be able to simulate stock movements and create some fun graphs. But I still have a couple basic questions about it myself.


If I have this right, the change $\Delta S$ in a stock price over a small time interval $\Delta t$ is posited to behave as


$\Delta S = \mu S \Delta t + \sigma \sqrt{\Delta t} \varepsilon S$


where $\mu = \text{drift rate}$, $\sigma = \text{volatility}$ (constant), and $\varepsilon$ is a fair coin flip resulting in $1$ and $-1$ (I prefer this incremental equation to a stochastic one, I'm not up on Ito's lemma and all that). $S_T$, the stock price at time $T$, is then (for fixed $\Delta t$) the random variable


$S_T = S_0 \left(1+\mu \Delta t + \sigma \sqrt{\Delta t} \right)^X \left(1+\mu \Delta t - \sigma \sqrt{\Delta t}\right)^{N-X}$


where $X$ is a binomial R.V. counting the number of $1$'s from the coin flips and $N = T/\Delta t$. Using the normal approximation for $X$ and letting $\Delta t \rightarrow 0$ gets us


$S_T = S_0 e^{(\mu-\sigma^2/2)T}e^{\sigma \sqrt{T} Z}$


where $Z$ is standard normal (or we could replace $\sqrt{T} Z$ with brownian motion $W$ for a dynamic model). From this we can compute the following expected values:


$\ln(E[S_T]) = \ln(S_0) + \mu T$


$E[\ln(S_T)] = \ln(S_0) + (\mu - \sigma^2/2) T$



First, a dumb question: if volatility isn't a concern, it's the second of these quantities that an investor is concerned with when deciding to purchase a stock, yes? i.e., the expected value of logarithmic returns is the correct measure of the performance of a stock, not log of the expected value?


My second question maybe isn't as dumb. Assuming what I just said is correct, does this imply that, in a world where this model held perfectly and that $\mu$ and $\sigma$ were known for all stocks and to all investors, that $\mu - \sigma^2/2 = r$, the risk-free rate? It would seem to, since a riskless bond with $\mu = r$ and $\sigma = 0$ is always available to investors. I'm asking because I'm curious and I'd like to say something intelligent to my students about the relationship between $\mu$ and $\sigma$ in this model, e.g higher $\sigma$ means higher $\mu$.


Another question. I'm told there's a magic wand called risk-neutral valuation which allows me instead to write


$\Delta S = r S \Delta t + \sigma \sqrt{\Delta t} \varepsilon^\star S$


where we've replaced $\mu$ with the risk-free rate and $\varepsilon^\star$ is a different random variable derived from the risk-neutral probability measure. I'll buy that for the moment. What confuses me is how, when deriving the Black-Scholes formula for European options, one arrives at the correct formula, even though we've replaced $\mu$ with $r$ but not replaced $\varepsilon$ with $\varepsilon^\star$.


What I mean is, suppose you write


$S_T = S_0 e^{(r-\sigma^2/2)T}e^{\sigma \sqrt{T} Z}$


That is, replacing $\mu$ with $r$ but not changing $\sigma$ to $0$ or changing anything in the second exponential (i.e. changing it to a different version of browning motion) If you use this expression to compute the discounted expected value of the payout of a European call option at strike price $K$


$e^{-rT}E[\text{max}(S_T - K,0)]$


one arrives at the correct formula for $C$, the Black-Scholes price of a European call option. But why should this be? Why should the fair value of such an option be arrived at by assuming $\mu = r$, but still assuming $\sigma \neq 0$? I realize that letting $\sigma = 0$ makes an option pointless to begin with, but I really don't get why we are justified in letting $\mu = r$, instead of what $\mu$ actually is (whatever it may be).



Finally, anything intelligent you can tell me about how actual investors react to (their estimation of) $\mu$ and $\sigma$, within the context of this model, would be helpful.


Sorry for my naivety, the closest I've been to a stock market is flipping past CNBC on my couch. Thanks for any help.


UPDATE:


What you've both said makes good sense to me. A quick aside: is the Riesz Representation theorem the essential ingredient one uses to prove the existence of risk-neutral measure?


I'm still fuzzy on one thing though. I've not been through the Black-Scholes PDE/dynamic hedging argument in detail but I get the gist; setting up a self-financing risk-less portfolio by trading back and forth the derivative and the stock. And I'm sure that's the most conceptually sound and insightful way to derive the Black-Scholes formula for European options. But I'm not going to have time to go into this in class, so let's suppose instead we didn't know any of this Black-Scholes PDE stuff, nor the Feynman-Kac formula. Again assuming the model


$S_T = S_0 e^{(\mu - \sigma^2/2)T} e^{\sigma \sqrt{T} Z}$


is there a way to argue from simpler principles that the computation


$e^{-rt} E[\text{max}(S_T-K,0)]$


is a valid pricing for a European option, after replacing $\mu$ with $r$? Because honestly, if I'm actually out there selling these options and need to price them, and I have no education about any of this other than this model, and I know I can sell enough of them for the law of averages to win out, I'm doing this exact computation but leaving $\mu$ right where it is (this was my original guess as to how to price an option by the way, before learning the actual formula or the hedging argument). In fact, it seems to me that, whatever probabilistic model $S_T$ you believe in for a particular stock, this computation should lead you to your best guess as to the value of the option, without any alterations such as letting $\mu = r$. Where am I going wrong here?


Finally, could you recommend some realistic values of $\mu$ and $\sigma$ for me to play around with my students? Do practical traders actually bother trying to estimate $\mu$ and $\sigma$?



Thanks for both of your help.



Answer



Let's take your questions in turn -



If volatility isn't a concern, an investor is concerned with $$ E[\log S_T] = \log S_0 + (\mu - \tfrac{1}{2}\sigma^2)T $$ when deciding to purchase a stock, yes? i.e. the expected value of logarithmic returns is the correct measure of the performance of a stock, not log of the expected value?



Yes, for long-term performance you should focus on the log-returns, as these incorporate the volatility drag that penalizes very volatile stocks.



Assuming what I just said is correct, does this imply that, in a world where this model held perfectly and that $\mu$ and $\sigma$ were known for all stocks and to all investors, that $\mu-\tfrac{1}{2}\sigma^2=r$, the risk-free rate?




In a world where the model held perfectly, and $\mu$ and $\sigma$ were known to all investors, and investors are risk-neutral, then this equation would hold. More generally you could have $$ \mu = r + \tfrac{1}{2}\lambda \sigma^2 $$ where $\lambda$ is the market price of risk. If $\lambda>1$ then investors are risk-averse i.e. they demand to be compensated with additional return for bearing risk. If $\lambda<1$ then investors are risk-seeking. A more sophisticated model is the capital asset pricing model (CAPM) which incorporates covariance with the market as an additional source of risk. Note that the CAPM is itself seen as a very simplistic and naive model of asset returns.



Why should the fair value of an option be arrived at by assuming $\mu=r$ but still assuming $\sigma\neq 0$?



The argument that leads to the Black-Scholes option pricing formula is a dynamic hedging argument. By following a particular trading strategy (i.e. buying and selling the stock in specified amounts) the investor can replicate the payout of a call or put option. Therefore, the price of the option must be equal to the cost of implementing this trading strategy (following the law of one price).


To determine the cost of implementing the trading strategy (in the limit of continuous pricing) you set up a PDE, the Black-Scholes equation,


$$ V_t + rSV_S + \tfrac{1}{2}\sigma^2S^2V_{SS} = rV $$


whose solution gives the price of the option. Note that $\mu$ does not appear in this equation (it drops out due to dynamic hedging) so the price of the option cannot depend on $\mu$.


Finally, the link to expectations (and the reason you can solve for the price of the option using Monte Carlo) is provided by the Feynman-Kac formula which translates the solutions of a certain class of parabolic PDEs (of which the Black-Scholes equation is one) to expectations of a particular stochastic process. Since the Black-Scholes equation does not depend on $\mu$, we know that the stochastic process cannot depend on $\mu$ either, and in fact the stochastic process turns out to be


$$ \frac{dS_t}{S_t} = r dt + \sigma dZ_t $$



with a terminal condition specified by the payout of the option (we use a terminal condition rather than an initial condition because the Black-Scholes equation has time reversed compared to a traditional, heat-like parabolic PDE).


That's the mathematical answer. The intuitive answer is "we can hedge out all of the price movements related to the drift of the stock, therefore the price of the option can't depend on the drift".


That is, even if you had two perfectly correlated stocks with a different drift term, and you bought a call option on each of them, the options would have a different terminal value (the one with higher drift would be worth more) but the costs of dynamically hedging the stock movements for the stock with greater drift would also be higher, by an amount which exactly offsets the difference in option terminal values, so the options have the same value now.


fiction - How much falling action can follow the climax?


I'm writing an action/adventure in the same genre as Indiana Jones or Tomb Raider. I've reached the climax, where the heroes have saved their friend from death at the last moment, and the cave/tomb is about to collapse around them. Now, I have a dilemma.



I currently have a scene after this where they escape. The midboss from before is back for one last fight, and they battle above a rickety old bridge, with a literal cliff hanger before the heroes escape to the surface. But that feels like I've put something mediocre after a stunning climax.


Alternatively, I can brush the escape aside and cut to them making it out just before the rocks fall, and pivot right into the resolution; or I can do something in the middle, where the escape is exciting but they don't fight a villain.


How do I know when to stop the action? The story isn't done, but the remainder can't compete with the climax. It almost feels like a required dangling bit of story, which feels unpleasant. How much falling action can I have before it starts to drag on?


Or, put another way, would the reader feel cheated if the scene cuts to the heroes escaping the dangerous underground with the friend they've saved?


EDIT: I know I can have story follow the climax for the purposes of tying off loose ends, mending relationships, etc. What I want to know is if there's room for action after an action-y climax: in this example, whether it would be underwhelming to show an escape from the underground temple after defeating the big boss.



Answer



The denouement, or resolution, has many story-related purposes, many of which Wikipedia nicely summarises, but it also has a reader-related purpose: that of gently guiding the reader out of the story and back into the real world.


Many of us fanboys and fangirls are very familiar with a kind of postpartum depression that overcomes us when a great book (or tv series) ends. I'm not listing movies here, because a movie does not last long enough for its protagonists become a familiar and habitual part of our lives. The reading of a novel (and the viewing of a tv series) on the other hand can take many days or weeks (or even years), during which we have half lived in the story's world, and half integrated the story's characters into our own. And then suddenly the narrative ends, and the character are wrenched out of our lives, and we out of theirs, and if you are at all like me then you will have shed many tears over that traumatic experience.


So what the denouement does for us is let the characters, instead of being brutally run over and unexpectedly wrenched from our lives by the speeding car of a climax, lie in bed for a few weeks, allowing us to say our goodbyes and come to terms with the natural end of the narrative.


So if you write someting that is at all intriguing, then do your readers the favor of having some few minor things happen after the big bang and let the story slowly peter out.





Of course not all stories need a denouement. They are most fitting after a long epic. Some stories have to suddenly break off to work.




If you cannot decide now, just write the story with the second climax. Then let it rest a while to distance yourself and read it again later with fresh eyes.


I had a scene in the first draft of a novel that felt both wrong and right. It had the emotional quality that I wanted, but really didn't make much sense on the level of story logic. But I couldn't bring myself to delete that scene, so I just wrote it in and left it there. Coming back to rewrite the story after a couple of months working on other things, my infatuation had cooled off enought that I could see how wrong that scene was and rewrote it. I didn't delete it completely, but changed it to something that made sense and felt right.


Writing is a lot of experimentation. You don't have to polish that section for your current draft, just write it roughly and see how it turns out. Maybe after getting it out of your system you are free to see how you could change it to something that feels good.


And trust your gut: if you doubt, then it's probably a bad idea. Good ideas feel right.


Saturday, December 28, 2019

monospace - Which fonts have the same width for every character?


I would like to have a font with all characters the same width.


For example, a W is wider than an i in most fonts ...Is there any font that has all characters equally wide?




Answer




The type style you're looking for is monospace. Wikipedia explains it well.



A monospaced font, also called a fixed-pitch, fixed-width, or non-proportional font, is a font whose letters and characters each occupy the same amount of horizontal space. [...]


Examples of monospaced fonts include Courier, Courier New, Lucida Console, Monaco, and Consolas. [...]




These days, just about every computer has one or both of these fonts:


Consolas



Courier


copywriting - Context sensitive help for wordy user preferences


Current UI


Here is a poorly designed panel on a preferences dialog for the open source audio editor 'Audacity'. I'd like to do something about it.


Wordy Preferences Dialog


How it got that way


In the past the text beside the radio buttons was short and cryptic. So many users were getting seriously unstuck with these options, we felt we had to put some more text there. Even at the time we made these changes to "Audacity", we were worried that it was becoming "Verbosity".



With the more wordy text it is still not 100% clear what these options do or why you would choose them. More explanation is needed. I want to trim the button text down back down to the short cryptic version, and design a nice way to present the detailed help text for each option.


Context Help in same Window


In line with answers to this question about context sensitive help in general, and my own instincts, pop-ups are out. So standard tooltips on hover, or a 'tell-me-more' link to open a new window aren't acceptable solutions.


I want a solution that is in the same window, and that makes it clear which text applies to which options. There is going to be more text than can fit in, so something is going to have to scroll or concertina...


Below is the preference panel for keyboard preferences. We're more space constrained here:


Keyboard Preferences


I want the user to be able to discover what 'Split Cut' means from the preferences panel. I'd like the context sensitive help to work 'in the same way' here.


How can I rearrange things to get the context sensitive help in?



Answer



How about this?



Export settings


and this Keyboard shortcuts


Also, I think that if you break down the list on the left to a few labeled logical groups, it will be a great improvement.


adobe illustrator - How do you use Apple's new emojis in Photoshop?


I'm trying to get a large version of one Apple's new emojis in Photoshop.


I know how to write with emojis in something like TextEdit, but I need the emoji to have a transparent background.


I've even tried writing the emoji in TextEdit, and copying and pasting into Photoshop but I just get an unknown unicode character.



I see the font is Apple Color Emoji in TextEdit when I highlight the emoji, yet I can't find that font in Photoshop.


Any idea on how to type emoji's into a text box in Photoshop?


Thank you!



Answer



While there may be hope for the future as modern operating systems develop support for full color fonts, what you would like to do is not currently possible in Photoshop. Only monochrome fonts can be used. The Apple Color Emoji font is a "special" type of font; glyphs are stored as PNGs rather than vector icons.


At this point, the best you'll be able to do is export the glyphs at the highest resolution possible and use that as a non-text object within Photoshop. This DeviantArt collection suggests that the maximum resolution is 160px². That resource doesn't appear to be fully up to date with the latest additions to Apple's Emoji collection but might include what you're looking for.


Friday, December 27, 2019

vector - Cutting paths with paths in Sketch.app


Goal: To come up with a set of curves on different scales to reproduce the typical "metro map" look. Also to learn what this kind of curve is called (not bezier, not rational?)


Given the following circular path, I would like to "cut" it along the lines shown in order to yield eight segments. I would repeat this process for various sized circles so that they nest as in the London tube map screenshot lower in the post.


In the end, I would remove the "fill" (the resulting paths would be "open" anyway, so unfilled anyway) and outfit it with a thick "line" to make the "tracks" of my would-be metro map.


Circle, overlaid with the



I tried every variation I could think of, with the circle and line on "top", using intersections and masking, perhaps I'm simply doing something wrong, I never used Sketch to modify shapes before.


Any option, including using the intersection points to add additional control points to the circle (so that I could select, and duplicate just two control points to get a 1/8 or 1/4 radius would work for me.


My alternative would be to learn enough geometry to write this as script for Sketch (luckily I'm a software engineer) and "program" out paths with the correct curvature, but I'm quite sure that turns out to be more difficult that it appears, not to mention my knowing nothing about geometry to calculate where the line 1000,0|1000,0 intersects the circle at north-east on it's face.


If I would have the luxury of using Illustrator I suppose I could use the "Pathfinder" tool to "outline" my shapes, according to this page:


Adobe Illustrator




London tube map screenshot, credit




shapes - Cut a circumference into parts - Inkscape


I'm trying to cut out sections of a circle / circumference.


The way that I've been doing it is by creating new nodes on the path and then cutting the path at that point. However, to make the cuts I then have to drag the circle freehand and it moves out of shape. How can I get around that?


Ideally, what I'm looking for is a circle with vertical cuts in it. Then I want to put shapes in the gaps, like so:


enter image description here



Answer






  1. Create a circle.




  2. Convert Object to Path.


    enter image description here




  3. Extensions → Modify Path → Add Nodes… Select by number of segments. In the example I chose five segments; you will likely want to choose a higher number.


    enter image description here





  4. Create a symmetric trapezium.


    enter image description here




  5. Select the trapezium and your circle and apply Extensions → Modify Path → Perspective.


    enter image description here




  6. Remove trapezium.





  7. In the Nodes tool, your circle should look like this (note how the nodes are not placed equidistantly):


    enter image description here




  8. Duplicate the circle an appropriate number of times.



  9. Move one duplicate upwards.



  10. Select all duplicates and use some vertical distribution tool from the alignment tools, e.g., Distribute centres equidistantly vertically.


    enter image description here




  11. Remove unneeded duplicates.




  12. Use Path → Combine on the remaining ones.


    enter image description here





  13. Remove some segments by selecting the appropriate nodes and using Delete segment between two non-endpoint nodes.


    enter image description here




  14. Add some segments by selecting the appropriate nodes and using Join selected endnotes with a new segment.


    enter image description here




  15. Repeat as desired.



    enter image description here




  16. Use Path → Break Apart.




  17. Remove spurios path segments.


    enter image description here





You can replace steps 4 to 6 by just distorting the circle to an ellipsis, but I assumed that the above is closer to what you desire. Also, you can get a more accurate perspective by placing step 8 before step 4 and applying steps 4 to 6 seperately to every circle (with different trapeziums).


Thursday, December 26, 2019

software recommendation - What is a good free font management tool for linux?


I've been trying to find a font management tool that is free, but all solutions are comercial. Is there a good font management tool that is free?



Answer




I'm unsure about the goodness, but Fontmatrix is a free & open–source font manager that is available to Linux (as well as to Windows & OS X). Its searching and font comparison tools seem to be comprehensive.


The UI may be a bit rough on the edges and development isn't exactly rapid (last update 1½ years ago), but at least the price is right!


Screenshot (courtesy of Fontmatrix):


Fontmatrix screenshot


black scholes - Positive theta on a long put?


I am trying to hand-price options under the Black-Scholes model.


Given the following parameters:



  • Stock price: $12.53$

  • Strike price: $14.00$

  • Risk-free rate: $0.03$

  • Annualized Volatility: $0.10$

  • Time until expiry in years = $.238095$



The put will have a positive theta of $0.354295$. It has a very high probability of ending up ITM (using delta as an approximation, $\Delta = -0.982251$).


What is the intuition behind this behavior? I thought for long options theta is always negative as a long option loses it's extrinsic value over time. I could see a short option having a positive theta, but a long option? This behavior seems unintuitive.



Answer



If a european option value becomes lower than intrinsic value it gets negative time value.


In this circumstance the theta becomes positive because as time approaches to expiry the option value has to converge to intrinsic value.


For european options there are 2 circumstances that can lead to the option value being lower than intrinsic value



  1. deep ITM puts in presence of positive interest rates $r>0$

  2. deep ITM calls in presence of positive dividend yield $q>0$



Note that those are the 2 circumstances under which it makes sense for an american option to be exercised early.


For more details you can check the actual formula for theta on the wikipedia page dedicated to greeks


Greeks formulas (wp)


Wednesday, December 25, 2019

scrolling - What are arguments against the usage of a ticker / marquee on websites?


I was recently asked to add a ticker (with daily updates) to one of our HTML-based dashboards. (A ticker would be text scrolling through the screen. In the past you could achieve something like that with the marquee tag in HTML.)


an example of a scrolling marquee/ticker


I personally don't like tickers and think they are a thing of the last century, but that's not really a good argument. There have to be better arguments though, because none of the websites I frequently visit use tickers anymore.


Do you now better arguments against the usage of tickers?




Answer



Tickers are like carousels, but worse.


Since you're asking for disadvantages, tickers are an antipattern because:




  • The content is unpredictable for users. Users don't know how large the content is, what order it appears in, where it starts or ends, and how long it will take to read all of it.




  • It either scrolls too slow or too fast. If a reader is focused on reading the ticker, she will read it faster than it scrolls, which makes for a frustrating experience. On the other hand, if the scroll speed is increased, then users not focused on the ticker will find it difficult to focus on the content because it's moving too quickly.





  • It's hard to read moving text. It's well studied that people don't read smoothly, but rather read words in chunks. Having those words move makes for a difficult reading experience (users spend disproportionate effort reading the moving letters, which reduces capacity for understanding the content).




  • It's visually distracting. Moving elements on a page will automatically grab user attention. In the case of a ticker, the content is usually supposed to be peripheral to the main content on a page, but the animation causes it to be distracting to the main content.




Finally, the empirics support your point of view. There are very good reasons why tickers are not used on the vast majority of websites today!


credit - Documentation of the ISDA CDS standard model


I have to validate the use of the ISDA CDS standard model.


Don't understand me wrong - I am sure that the ISDA model is "good" I just need to know what it is in detail.


I can download an Excel-plugin and C code but I can not find a full documentation of the model. I assume that it is a constant hazard rate model or a present value model using the probabilities of default similar to what one can find e.g. in Hull.


Does anyone have a link to the official and full documentation?



EDIT: I have found this where the authors write about the ISDA CDS standard model. It would nevertheless be useful to have the official documentation by ISDA.



Answer



I could not find any such detailed documentation after some weeks of looking (not non-stop obviously). It is appallingly documented. I do understand fully what it does though so am happy to field some questions on it if you like.


In a nutshell, I can tell you it is a standard reduced-form credit model under a constant hazard rate (i.e. homogeneous Poisson process). As such it assumes that the default-intensity is not stochastic and is therefore totally unsuitable for any type of quant modelling.


In fact, it is not intended for modelling but only serves as a market-standard converter from Quoted Spreads to CDS Upfront. Somewhat analogously to Black-Scholes Implied Vol, nobody thinks that the underlying follows a simple drift diffusion - IV is only a quoting mechanism for option "value".


It is the Upfront $UF = (S_{ISDA}-C)RPV01_{ISDA}$ that is the market-value of the CDS contract and the Quoted Spreads are only a quoting convention which, in conjunction with the ISDA Standard Converter produce that Upfront mark-to-market - (in this way, Quoted Spreads $S_{ISDA}$ are specifically intended for ISDA "Model" $RPV01_{ISDA}$ Conversion).


You could equally come up with your own model (based on say a CIR intensity diffusion) which would have its own spreads $S_{CIR}$ (different to the market quoted spreads) but MUST convert via $RPV01_{CIR}$ to the same Upfront $UF$ which is the value actually exchanged in trading.


$(S_{CIR}-C)RPV01_{CIR} = UF = (S_{ISDA}-C)RPV01_{ISDA}$


You need the ISDA model only in so far as, given a timeseries of Quoted Spreads you need to convert to a timeseries of Upfronts (points-upfront) to subsequently apply your own stochastic model to (the daily differences in points-upfront, which has a convex relationship to the daily differences in quoted spreads). Outside of the spread-to-upfront conversion the ISDA "model" has no (intended or practical) usefulness at all.


Read Damiano Brigo and also the Barclays' "STANDARD CORPORATE CDS HANDBOOK" (2010).



I have a Matlab mex file of the ISDA Source Code Converter which I would happily share with you, but you will need to parse the ISDA Swap Fixings XML Files yourself, to reproduce exactly what you see on Bloomberg CDSW


Best Rgds, Mark


market data - Mapping symbols between tickers, Reuters RICs and Bloomberg tickers



Is there any known solution (preferably open source) to map between ticker symbols, Reuters and Bloomberg symbols. For example:



  • Ticker: AAPL

  • Reuters: AAPL.O (may be prefixed with RSF.ANY. dependent upon infrastructure)

  • Bloomberg: AAPL US Equity


Edit: by mapping I mean translating from one symbol naming convention to another. For example let's say we have RSF.ANY.AAPL.O and want to get Bloomber equivalent, which is "AAPL US Equity".


Edit2: Fixed Bloomber mapping, it should be "AAPL US Equity" not "AAPL:US"



Answer



Here are some pointers.



First of all: What you list as a Reuters RIC, RSF.ANY.AAPL.OQ, is not really a RIC, only the AAPL.OQ is. The initial part is some stuff which is essentially site specific and tells me that you are working on a site that has a legacy RTIC infrastructure (some Reuters/TIBCO technology which is quite old these days and for all practical purposes has been deprecated in favour of other distribution mechanisms, most notably the ADS). Ok, the AAPL.OQ is the RIC, and only that. The initial part, the RSF.ANY denotes the feed and that is because the Reuters Market Data System (an in-house ticker plant) is vendor agnostic and can have any feed on it, for example Bloomberg. So the initial part could might as well be BB.ANY in order to denote the site's Bloomberg feed. .. and then the latter part would of course be a Bloomberg symbol, not a RIC. But we are getting ahead of ourselves here and mixing technology implementation with that of instrument naming schemes, most notably the RIC and the BSYM.


With regards to how Reuters RICs are constructed you can read this guide. This document also exist on the Thomson Reuters web site but it doesn't seem to be available without registration. I just found the public link by Googling. There may be a newer version of this document but I doubt it makes much of a difference. RICs have been constructed the same way for ages.


As for the Bloomberg Symbology (BSYM) you can find more information on this link. Bloomberg has multiple identifiers to identify the same thing. Only the BBGID (Bloomberg Global ID) doesn't change with name changes, i.e it is constant over time. The downside is that it is totally meaningless. Another way to access a data item is to use a combination of the Ticker, Market and Pricing source with spaces between them.


Both Reuters and Bloomberg try to use the exchange's ticker symbol as part of their naming standard whenever possible. Unfortunately some exchanges use incomprehensible ticker symbols but that is not really the fault of Reuters or Bloomberg.


Bloomberg has made their symbology available under a very liberal "open source" license. Don't be fooled though. He who defines the universe, owns it. Without an impartial body to allocate the symbols it is really not worth much, IMHO. The difficulty in naming financial instruments lies not so much with exchange traded instruments like equities. That is rather simple: Take the exchange's own ticker symbol and then add some self-invented identifier to denote the market place. That's how both Reuters and Bloomberg do it. Nope, my friend, the difficulty (and the real lock-in) is with all the OTC instruments.


icons - What symbol to use to represent feedback


When reading Which "Like" symbol is best to use I suddenly realised that the UX community may be able to help me solve a little problem:


I'm working on a site which has just gone in to Beta and as part of the beta testing we're allowing the public to send feedback.


The site needed an obvious visual representation to encourage feedback from users. The usual method is the [+] icon. To me this just means 'expand' and doesn't necessarily suggest that the site is looking for feedback. Other options we explored were a pencil writing in a form - this just means edit so I didn't want to go with this. We considered a tick/cross icon and a speech bubble but ended up with a facebook-style "thumbs up"


Cusomter feedback example image


TLDR - My questions are:




1) What is the best symbol to encourage feedback and why?


2) Does a 'Like' style thumbs up icon either a) encourage positive feedback or b) discourage negative feedback as users will think it is a link to give "Liked" feedback only



EDIT:


The form behind the link is split in to several subsections:


Ease of use



  • 2 multiple (4) choice

  • 1 sentence answer "How easy to use is [the site]?"



Ease of understanding



  • 1 multiple choice

  • 1 text answer "How easy to use is [the site]?"


Usefulness for [performing the action of the site] (it's a journey planner)



  • 1 multiple choice

  • 1 text answer "Please comment on how useful you find [the site] for [the action]?"



Alternative services



  • 1 multiple choice


Further comments / improvements



  • 1 text answer "Please add any additional comments or improvement ideas below."

  • Do you require a response?

  • Name (text input)

  • Email (text input)




Answer



Customer Feedback Mockup


I would suggest using a megaphone icon, since it is



  • easily identified as a metaphor for "speaking out"

  • understood independent of age and cultural background of the intended audience

  • non-biasing towards positive or negative feedback.


style - Tips for making writing move fluidly


I think there's a problem in my writings, that I can describe as not being fluid, and lacking in smooth transitions.



Based upon this, I'm interested in tips at shifting focus smoothly between paragraphs.


Note: I'm not sure about whether the tag fits this Q, feel free to remove it if not.



Answer



The paragraph is the most indistinctly defined unit in all of writing theory. In the 19th century it was common for paragraph to run on of a page or two. Today, they often run only a few lines.


For instance, the paragraph break I just made does not really indicate a shift of thought or action or theme. There is no hard and fast reason that I can think of that would justify breaking it or not breaking it as I did. The main reason for the break it that it seems to give the reader a bit a of rest and make the text a little less daunting to read.


Why less daunting? It is unclear, at least to me. The thread of argument is the same as it would be if this were still part of the first paragraph (as it certainly would be in 19th and most of 20th century prose). The breaks don't make the argument any easier to understand. And yet somehow this answer will be perceived as easier to read for being in three paragraph rather than one.


All of which it so say that in many cases the focus does not shift between paragraphs. A whole sequence of paragraphs will generally have the same focus, and probably should.


In fiction, it takes time for a reader to settle into a scene. You have to build up a mental picture of the setting and the characters and the action and follow it through to a logical conclusion. A shift of focus is mentally taxing for the reader. Any text that shifts focus rapidly is going to be hard to follow for no other reason than that rapid shifts of focus are exhausting for the reader under the best of conditions.


Remember that prose is an asynchronous medium. Things do not happen in real time. Often an event takes far longer to describe than the event would have taken to occur, or, vice versa, far longer to happen than to describe. For this same reason, handling events that happen simultaneously by rapidly switching back and forth is usually a bad idea in prose. (It can work very well in movies, where the camera does most of the imaginative work for the viewer.)


So, first and foremost, the way to make writing flow fluidly is to maintain focus on a single scene or sequence for as long as you reasonably can. Shifts of focus are inherently taxing on the reader, so keep them to a minimum. There is nothing wrong in a book in sending Jack off on 80 pages of adventure, and then saying "As soon as Jack left, Jill went to fetch a pail of water". That is hard to do in the movies because they are a synchronous media and people expect the time sequence to be inviolate. It is hard to insert this simple bit of narrative in a movie. But in prose it is easy to do, and generally preferable, since it helps keep each narrative thread flowing smoothly.



Tuesday, December 24, 2019

Best way to make user complete each accordion of content


I have a page with a number of accordions on the page that are used to group certain items together and take up less screen space.


I want the user to know to have to go through each accordion to complete this step.


I have thought about having text above stating 0 complete of 4 etc and then having an icon to show complete / not complete.


I would love to hear your thoughts...



Answer



I think it makes sense to expand the first accordion by default so that users can start typing right away without clicking any controls. If the user has to go through each accordion you can reveal the next accordion if the user filled in the previous accordion. When the user fills in an accordion and clicks Submit the next accordion opens up and the previous accordion becomes read only with a control to make it editable. Apple checkout uses the same approach. Accordions, created in Axure LukeW wrote a very nice article about accordion design that is accompanied by the user tests. Accordions that had a primary control (e.g. Continue to move on) performed faster than accordions where the user had to click an accordion header. Also the accordion performed faster than a multi-page wizard.


What is the Swap Curve?


What is the so-called Swap Curve, and how does it relate to the Zero Curve (or spot yield curve)?


Does it only refer to a curve of swap rates versus maturities found in the market? Or is it a swap equivalent of a spot-yield curve constructed from bootstrapping a bond yield curve?


The context of this question is set against a backdrop of a plethora of terminology (that seems to be used interchangeably). I am looking into how the so-called Zero Curve (or spot yield curve) is constructed in order to discount various IR derivatives (including swaps) when pricing them.



Answer



Garabedian,


Typically, the "swap curve" refers to an x-y chart of par swap rates plotted against their time to maturity. This is typically called the "par swap curve."


Your second question, "how it relates to the zero curve," is very complex in the post-crisis world.


I think it's helpful to start the discussion with a government bond yield curve to clarify some concepts and terminologies. Consider the US Treasury market, using the outstanding Treasury notes and bonds (nearly 300 of them...), we can either use bootstrapping or more sophisticated spline models to construct a "fitted curve." Since this yield curve represents bonds of identical credit risks (basically risk-free), the zero coupon curve, the discount curve, the forward curve, and the par yield curve are just different representations of the same thing and can be translated very easily from each other. For simplicity, I'll assume annual compounding:




  • If you know the zero coupon rate $r_t$ for time $t$, then the discount factor is $1 / (1 + r_t)^t$.

  • If you know the 1-year zero coupon rate $r_1$ and 2-year zero coupon rate $r_2$, then you can compute the 1-year forward 1-year rate from $(1 + r_1)(1+f_{1,1})=(1+r_2)^2$.

  • You can also compute the 2-year par rate, just solve for $c$ from $$ \frac{c}{(1 + r_1)} + \frac{100 + c}{(1+r_2)^2} = 100. $$


Now let's return to the swap market. To be concrete, let's consider a 2-year USD par swap. This instrument has four fixed leg payment, and eight floating payment. The par swap rate is the fixed-leg interest rate that sets the present value of all the cash flows to 0. In other words, we'd solve for the $c$ in: $$ \sum_{i=1}^4 c \Delta_i d(T_i) = \sum_{j=1}^8 l_j \delta_j d(t_j), $$ where $d(t)$ is the discount factor for time $t$, $\Delta_i$ and $\delta_i$ are year fractions, and $l_j$'s are the 3M Libor forward rates.


Before the financial crisis, it is assumed that the discount curve and the forward curve are both based on Libor. This simplifies things a lot – just build a Libor forward curve so that it reproduces libors, futures rates, and par swap rates, and you're done. In this framework, all the translations (from zero curve to par curve to forward curve, etc.) above are still valid.


Unfortunately, the idea that Libor was the appropriate funding rate was completely invalidated during the crisis. In recent years, a common practice is to use the "OIS discounting"-based "multi-curve" approach. In the equation above, the $l_i$'s are still based on the 3M Libor forward curve, but the $d(t)$'s should be discount factors fitted to overnight indexed swaps.


Simply put, when you are building a swap curve, you now need to simultaneously calibrate both the OIS discount curve AND and Libor discount curve... Under this new paradigm, the simple translation that we used for government bonds above no longer works, since multiple curves are involved.


But it gets worse... since 1M Libor and 3M Libor have different credit risks, you can't even do something like $(1 + \text{Libor}_{\rm 1M}/12)(1 + \text{Libor}_\text{1 month forward 2 month} / 2) = 1 + \text{Libor}_{\rm 3M} / 4$! Instead, you need to build separate 1M and 3M Libor forward curves to account for the tenor basis...


As you can see, building a swap curve nowadays is a pretty involved task. What we now refer to as "a" swap curve is actually a collection of curves (OIS curve, 1m libor, 3m libor, 6m libor, etc.) bundled together...



There are numerous literature you can find on this topic just by googling "multi-curve". For example, http://developers.opengamma.com/quantitative-research/Multiple-Curve-Construction-OpenGamma.pdf


Best resolution for creating a design


I'm just starting to learn web design and ux and I have a very simple question. What is the best resolution to design for?


For example, I want to design a WP Plugin settings page, what resolution should it be? What resolution should I use for the buttons?




Efficient use of Illustrator's export File Dialogue


When I File > Export using Artboards from Illustrator the (OSX)file dialogue is always pointing at the directory where the Illustrator document is located. If I need to export to a different directory I have to navigate through the filesystem to find it.


The next time I export Illustrator has forgotten this directory and I have to do this all over again. When I am exporting, previewing a webpage that uses the artwork, tweaking and re-exporting repeatedly this is a massive speed bump. I'm sure the answer is painfully simple but what is it?



Answer



There is a shortcut in OSX that presents the last few folders in the save dialog, In the save dialog window, directly under the filename area is a dropdown that reveals the folder structure for the current folder AND below that list is one called 'recent places' which list your most recent folders. Not automated but very handy, so to is the 'save for web' option remembers last folder.


Monday, December 23, 2019

Formal proof for risk-neutral pricing formula


As you know, the key equation of risk neutral pricing is the following:


$$\exp^{-rt} S_t = E_Q[\exp^{-rT} S_T | \mathcal{F}_t]$$


That is, discounted prices are Q-martingales.


It makes real-sense for me from an economic point of view, but is there any "proof" of that?


I'm not sure my question makes real sense, and an answer could be "there is no need to prove anything, we create the RN measure such that this property holds"...



Is this sufficient to prove that, within this model, the risk-neutral measure exists?


EDIT:


Some answers might have been misled by my notation.


Here is a new one:


$$\exp^{-rt} X_t = E_Q[\exp^{-rT} X_T | \mathcal{F}_t]$$


where $X_t$ can be any financial asset. For example, a binary option on an underlying stock $S$.


In order to price the option, you would start with this equation and develop the right-hand side to finally solve for $X_t$.


My key question: what allows me to write the initial equation assuming I have no information about the dynamics of the option or its underlying.



Answer



Note first that this key equation is only assumed to hold true under some extra assumptions. Typically those assumptions are taken to be about absence of arbitrage, though it is possible to weaken them somewhat if you are willing to consider portfolio arguments or collectively agreeable objective function.



Anyway, the argument is this: if all the risk can be arbitraged away, then the price of any contingent claim should be equal to its price under the risk-neutral measure Q.


The mathematical proof can be grasped most easily by the old-school arguments where one shows delta-hedges eliminating stochastic terms from the SDE. More mathematically elegant arguments involving the Girsanov theorem and Feynman-Kac formula are less intuitive.


capm - Excess, Residual and Active Return



in CAPM. What's the difference between these different types of returns?



  • Active return

  • Excess return

  • Residual return



Answer



Active return: $R-R_m$ i.e. your security (or portfolio) compared to the market portfolio. Used to judge performance before the CAPM was invented


Excess return: $R-R_f$ the security compared to the risk free rate, appears on the left hand side of the CAPM equation.


Excess return on the market: $R_m-R_f$, appears on the right hand side



In words the CAPM says that "there is a linear relationship between the excess return and the excess return on the market" $R-R_f=\beta(R_m-R_f)+\epsilon_i$


Residual return: $R-R_f-\beta(R_m-R_f)$ i.e. the part of your return which the CAPM does not explain, or your outperformance versus the CAPM; its estimated value over a period of time is called Alpha. This is what is advocated to measure performance under the CAPM.


How to choose the right color shades/tints for branding?


I’ve read a lot about color theoretical methods to pick a harmonic color palette (e.g. for branding), but I always wondered how to pick the corresponding shades and tints (see Google’s material design color palette for example).


Is there a proper way to choose darker and brighter variants of the original colors without loosing color harmony (especially between a original color and a variant of another)?



Answer



This is exactly what the HSB colour model is for. HSB splits the colour into the values Hue (H), or colour type; Saturation (S), or (inverse) amount of white in the colour; and Brightness (B), (inverse) amount of black.


enter image description here


Hue is expressed in degrees, with 0° being red, and 180° being cyan.


Saturation and Brightness are expressed in precentages. 0% Saturation is just white, no colour, and 100% is no white, just the colour. 0% Brightness is all black and 100% brightness has no black left mixed in.


Any current design program has a colour picker that includes the HSB (or HSV) model. Pick the colour you want alternatives for, and play around with its S and B values. As a rule of thumb, decrease saturation for a lighter variant and decrease brightness for a darker one.



All these variants harmonise with your base colour naturally.


The HSB model is a great base to build entire colour palettes on, using only a few values of H and creating variants of those with S and B. If you use colour theory to choose your base values of H so they harmonise, then their variants created by changing S and B will also harmonise with each other.


Sunday, December 22, 2019

adobe photoshop - How to create a speckled/pixelated background?


How would I replicate this speckled/pixelated background effect?


Speckled/pixelated background effect


You might need to zoom in to see the effect fully.



Answer



This is pretty simple.


Create your background layer and fill it with the color that you want. Then choose Filters>Noise>Add Noise... from the menus. Make sure Monochromatic is checked, and adjust the Amount until it looks how you want.



Hope this helps!


research - Should I write a companion book/blog?


As a spinoff to this question: Incorporating research and background: How much is too much?


I'm writing a middle-grade fantasy novel with a historical fiction component based in Ancient Egypt. I'm doing enormous amounts of research on both the history and the religious aspects (it's based on the Exodus). A lot of people seem to think my research would be of interest to people and have suggested I consider a companion book and/or a blog.


Obviously I don't want to take away writing time for my novel. I have to finish it first. But the longer I wait with research notes, the more I forget the details. Writing everything down takes a while.


Has anyone done this or seen this done (especially not by hugely popular books/authors...I mean, let's not count A Song of Ice and Fire)? Is it just another time sink to slow down finishing my novel? Or is it worthwhile?




Adobe Illustrator CS5: how to save background color to pdf


I changed the background colour of my pdf through:


Document Setup -> changing color under "transparency" (grid color) -> checking "Simulate Colored Paper"


This changes the background in Illustrator as it should. The problem is: if I save the file as a pdf, the background if my pdf is white again :-(


Any idea how to solve this problem? Many thanks in advance!



Answer



As it should. If you'd end up with a coloured background in the *.pdf and printed it on the coloured paper, the coloured paper would get a coloured background printed on it, for twice the colour value.


Changing your backgrond colour is as easy as drawing a large rectangle behind your work in the correct colour and, preferably, locking it.


Given a correlation martrix, calculate portfolio's correlation with its assets


Find correlation vector like $[ d e f ]$ where d, e and f represent correlation of P(portfolio) with its assets A, B and C respectively. The assets A, B, C can be another portfolio.


In order for that, is it possible to find a correlation matrix including the portfolio along with its asset, given the correlation matrix for the assets in the portfolio? For example, for 3 assets A,B, C you have correlation matrix as $$\left(\begin{matrix} 1 & a & b \\ a & 1 & c \\ b & c & 1 \end{matrix}\right)$$ Now, using this or some other data concisely get a new correlation matrix for assets A,B,C, and P(for portfolio) like $$\left(\begin{matrix} 1 & a & b & d \\ a & 1 & c & e\\ b & c & 1 & f \\ d & e & f & 1 \end{matrix}\right) $$


Solution: The real interest is getting the $[ d e f ]$ vector, which can be generalized in matrix form. Let P be combined portfolio consisting of N assets or sub portfolios. Let Vector Cov(P)= [Cov(P,1) Cov(P,2) ... Cov(P,N)]', $\Sigma$ is the variance covariance matrix of portfolio P, and vector w=[w(P,1) w(P,2) ... w(P,N)] then $$Cov(P)= \Sigma w $$ $$ D=diag(sqrt(diag(\Sigma)) $$ $$ Corr(P)=D^{-1} Cov(P) D^{-1} $$



Answer



It's probably easiest to think about it in terms of a covariance matrix and then convert it to a correlation matrix after. If instead of the first matrix you have some covariance matrix of the assets $\Sigma$, then you could get the portfolio variance, for one portfolio, as $w' \Sigma w $, where you could have $w\equiv\left(w_{1},w_{2},w_{3}\right)'$. Alternately, you could construct a matrix $W$, such that $W\equiv\left[\begin{array}{cc} I & w\end{array}\right] $, where $I$ is a $3 \times 3$ identity matrix in your case (but really could be something more general). Calculating $W' \Sigma W$ would give you a matrix such that the top left $3 \times 3$ is the original covariance matrix and then is appended with the variance of the portfolio and its covariance with the securities. You can then convert the covariance matrix to a correlation matrix to have the final result you want.


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