Wednesday, February 28, 2018

usability - Should I force the user to enter an email before actually using a paid app?


I am working on an iPad app. It's in the medical field and the app will be sold for $99, which is kind of expensive!


The client and the developer want to force the user to give his/her email address to build up a data base and also provide services in the future. The main reason why a doctor would give the address would be because he/she wants to export a PDF. They want to make it compulsory. If you don't give your email, you can't use the App.


As the UI and UX designer, I tell the client and the developer that it's a very bad practice to ask for the email in a paid app before the user can use the app. I keep telling them that they will have a far better opt-in conversion rate if they let users use the app before asking for this.


I think it's a very bad practice, what do you think?
How would you explain to them that it's not good (if it's not good)?




resources - Thoughts on creating a portfolio?


I would like to put together an online portfolio for my UX work. However given that I work in-house on a single project, rather than for an agency, I'm wondering what I ought to include.


Are videos too lengthy to include, or will before and after screen shots (prototypes compared to finished product) be sufficient?


What's the winning formula that's worked for other UX folk?


I should mention a couple of caveats:



  • I'm not a developer, as I focus more on the interaction design and usability side of things, so the site will be basic.

  • The projects I work on aren't publicly available on the web, so I can't provide URLs.

  • I only do low-fi prototypes (i.e. no coding, just paper & pencil or Balsamiq).





Tuesday, February 27, 2018

lognormal - How to calculate future distribution of price using volatility?


I want to create a lognormal distribution of future stock prices. Using a monte carlo simulation I came up with the standard deviation as being $\sqrt{(days/252)}$ $*volatility*mean*$ $\log(mean)$. Is this correct?




Answer



I'm not sure I understand, but if you want to compute the variance of $exp(X)$, where $X$ is normally distributed with mean $\mu$ and variance $\sigma^2$, that variance is (from Wikipedia): $$\left(\exp{(\sigma^2)} - 1\right) \exp{(2\mu + \sigma^2)}$$


Monday, February 26, 2018

Font management tool across multiple machines


I have mac pro, imac and mac air and all of which I use at various times in the work flow creating a range of media.


I have various fonts across all three and have been trying to manage with font book, which just isn't cutting it. It's time to move to something useful in my situation.


What should I look for in a package that will help manage fonts across my machines? Do I need a server solution or would something else work in this small office?




selection - Moving Elements Between Lists



I have a question... I'm dealing with an interface that has two lists, and you can drag and drop elements between them.


What would be a better approach and why?


a) Moving between lists doesn't change any behavior of the buttons between them. If item three is moved to the right, the system will remove the item from the source list, select the next available item in it and put it desired item in the target list. Focus of previously selected item gets lost and replaced by another one. (In the figure below, Item Three was pushed to the other list, and Item Four got selected).


mockup


download bmml source – Wireframes created with Balsamiq Mockups


b) The behavior of the middle button changes, as the item selected doesn't lose focus. As opposed to previous example, moving clicking once on the middle button > will move the item from one list to the other and it will change to <.


mockup


download bmml source


In my opinion, option b is more friendly as it allows you to go back to a previous state (undo) easily. It also removes the need for disabling buttons, and having items selected on both lists, and that to me makes it a bit easier to use.





Bonus: Considering solution a) we know that when an item on the left list is selected, it can only go to the list in the right, and the other way around; when an item on the list on the right is selected, it can only go to the left list. Would disabling buttons accordingly may be annoying to the user or should be encouraged?



Answer



Take a look at the bigger picture. What is the user going to do next? Probably not undo - possible but not probable?


If the likely next step is to move another item from the left list to the right then you should leave focus on the next item in the source list, so that the user can move multiple items easily be sequential pressing of the arrow button. So to move items 2,3 and 4, you'd select item 2 and then press the arrow button 3 times.


Similarly if you moved an item from the right list to the left.


Assuming the list is ordered, you should maintain the same order in the second list as the first, unless there is a good reason not to (like the list is acting as a history of chronological events and is ordered by most recently added).


There's no need to disable (grey out) buttons except when one list is empty, and don't hide them at all as it prevents visual exploration of the affordances of the scene.


So option a) it is.


Sunday, February 25, 2018

fiction - Must protagonists be flawed for satisfying character evolution?



Many screenwriting theories hold that the protagonist should be flawed at the story's beginning and overcome this flaw by its end.


Now, there are stories where the protagonist is thrown out of a seemingly normal, happy and functional life only by the intervention of the antagonist. Think of all the tales of killed or abducted wives and children.


Does the protagonist of such a story need or usually have a "flaw" beyond the desperation, hate, or guilt caused by the antagonist?




tools - What computer hardware matters to a graphic designer?


I've had my MacBook Pro since 2007 and I'm starting to think about what the next system might look like. I'm not made of money, but if upgrading a component helps to make me a more efficient worker for 5+ years, that's worth something to me. Point being, I don't want to just max out every category; I want to be smart about it.


So, what bits of hardware matter the most to a designer? Is a dedicated graphics card overkill for a Creative Suite power user? If not, how fast should a GPU be to handle Photoshop and cutting-edge Web technologies? How much of a difference would four cores make over two when I run a script in Illustrator? Does the usage of design software mean that my system would need more RAM? Two small monitors or one big one?


I know storage space is a big deal, so straight solid state probably isn't viable...but having OS and Creative Suite on a smaller drive and throwing in a 1TB drive might work really well. That's the kind of thinking I'm trying to have.


Along the same lines, has anyone gone to the desktop to save some bucks and regretted it later? Can a desktop plus a tablet fill in well enough for a laptop?




chapters - Use of Separating Fiction into "Parts?"


I was wondering about the use of separating fiction into "parts", similar to chapters but larger and spanning more text and using these to divide up books within a series. If I am unclear, refer to Miss Peregrine's Home for Peculiar Children, Book 2, Hollow City. In this series, the second book is divided into two sections: part 1 and part 2, as well as chapters.


I was wondering where this is done in various works of fiction. I assume within a single stand-alone book it should be fine, but would it still be fine within a series where not all the books are divided into parts that way, such as the Miss Peregrine's book series? How about for a novella? Is it more advisable to keep all the content in one main body than to divide it in a smaller text?



Answer




Breaking a book into parts is very common, in series books and in standalone books.


I haven't read the books you mention, so I can't comment on those.


Just yesterday I finished reading Mr. Mercedes, by Stephen King. He breaks the book into parts. Each time I got to the title page for a new part, I realized I was about to enter a new phase of the story. It sort of shifted my mood a little. Not a big effect, but a definite one. Especially for the final part, where the title made it clear that we were headed for the climax of the story. I definitely felt an added bit of anticipation.


For this story, breaking the book into parts worked well for me as a reader.


So that's one effect of breaking a book into parts. There are probably others.


The question is: Do you want to create that kind effect in the reader? If so, break your book into parts. If you'd rather give the reader a more subtle or continuous experience of the flow of the book, rather than announcing transitions so blatantly, don't break it into parts.


That's a question for each book, even each book in a series. Even if one book benefits from explicit breaks between parts, that doesn't mean you need breaks in every book. (I don't know whether the two following books in King's series are separated into parts.)


filtering - Show filtered results in real time?


We are building a product category page with a couple of filter options to let the user remove uninteresting products. The filter options are for example color, size, specific product features etc.


What is your experience with updating the product listing as the user select different options (the page doesn't reload)? My case against updating the result in real time is that it could distract the users.


Should you do that or is it better to use a button as a trigger?




Saturday, February 24, 2018

parameters in Heston model and their impact on volatility smile


Consider the Heston model given by the following set of stochastic differential equations: $$\frac{dS_{t}}{S_{t}}=\mu_{t}dt+\sqrt{V_{t}}dW_{t}, S_{0}>0,$$ $$dV_{t}=\kappa(\theta-V_{t})dt+\xi\sqrt{V_{t}}dZ_{t}, V_{0}=v_{0}>0,$$ $$d_{t}=\rho dt$$ where $W_{t}$ and $Z_{t}$ are two brownian motion, $\kappa,\theta,\xi>0, \rho\in(-1,1).$ I don't understand what impact would $\rho$ have on the shape of volatility smile when it's negative or positive. In addition, How the volatility smile would change if $\xi$ increases? Thank you.



Answer




Intuition: You can think of the vol smile as a reflection of the risk neutral distribution (compared to the Black Scholes Gaussian density). A fat tailed distribution creates the smile: fat tail -> higher prob of exercise than Gaussian with constant stdev -> higher option price than BS with ATM vol -> higher implied vol for given strike. Skewed distributions cause skewed smile: neg skew -> left tail thicker than right -> OTM put impl vol higher than OTM call impl vol.


Also you can think of a stoch vol model as mixture of Gaussians, each with different volatility. The way that this mix is produced generates fat tailed and skewed distributions.


Non-zero Rho will produce asymmetric volatility smiles (that look more like skews). Negative correlation means that a negative spot shock is more likely accompanied by a positive vol shock -> as spot goes down we mix with higher vols -> will produce a fatter left tail than right -> negatively skewed risk neutral density -> downward sloping skew.


Large Xi produces a steeper, more pronounced smile/skew, as we increase the vol-of-vol potentially mixing with higher volatilities which generate more leptokurtic risk neutral distributions. Zero Xi would correspond to the Black Scholes case where the smile becomes flat.


To be more rigorous you can take the Heston char function, take derivatives to compute moments and show the relation of Rho/Xi with Skewness/Kurtosis.


automated trading - How to account for transaction costs in a simulated market environment?


I am simulating a market for my trading system. I have no ask-bid prices in my dataset and use adjusted close for both buy and sell price. To account for this I plan to use a relative transaction cost.


The question is how large such a relative transaction cost should be to be realistic?




  • I trade stocks only from Dow Jones Industrial average (read that it might be around 0.2% in this paper)





  • I trade only on day-to-day (no intraday) thus I can assume to buy at close prices (adjusted close?)




  • I simulate trades in the time period 2000-2012




  • By transaction cost I am interested in any cost related to a real trade, e.g., brokerage fee, spread, slippage (thanks @chrisaycock)






Answer



We cannot give you a relative bid-ask spread that would make sense. The reason for that is that it really depends on several parameters:



  • The type of financial asset you invest in (futures, funds, index, options, ...)

  • The period during which you're trading (I think the liquidity in markets hasn't been the same over time).

  • If you trade intraday, it depends on the time you trade at.

  • If you assume you trade close price, you would submit MOC (market on close) orders. Your broker is most likely to be able to sometimes execute your orders at a better price than the close, and sometimes the opposite. I think that some brokers will have some terms that allow you to make sure that your trade will be exactly the close price, I've seen this for some commodity futures.


Finally, bid-ask spreads are not transaction cost per-say; they are the market price of liquidity in a sense. Your transaction costs would be more a fee that is charged by the broker for executing the order. It depends more on the quantity you trade and the terms you manage to negotiate with your broker.


correlation - How to simulate correlated assets for illustrating portfolio diversification?


I have seen multiple instances where people try to explain the diversification effects of having assets with a certain level of correlation, especially in the "most diversified portfolio" literature. A nice example is in the NewEdge's "Superstars vs. Teamwork":


enter image description here


How can I simulate multiple random walk series that have a calibrated level of correlation to each other in order to demonstrate this? My thought is to have a random walk series $x$ and to add varied different levels of noise $n$.


$$r_i = \lambda x + (1 - \lambda) n_i$$


where $$0 \le \lambda \le 1$$


So less noise (large values of $\lambda$) will generate series with high correlation vs. more noise. But is there are more theoretical way to calibrate a certain level of correlation? I'm simulating this in R, so any R functions would be additionally helpful!




Answer



Your formula looks like cointegration (between the price time series) rather than correlation (between the returns).


To simulate "correlated random walks", i.e., random walks built from correlated innovations, you can just build the desired covariance matrix (for instance, put ones on the diagonal and $\rho$ everywhere else), take multivariate gaussian samples with this covariance matrix (in R, you can use the mvtnorm package, or take independent gaussian variables and multiply them by the Choleski matrix), and take the cumulated sum to have an arithmetic random walk.


k <- 10
rho <- .9
sigma <- matrix(rho, nc=k, nr=k)
diag(sigma) <- 1
n <- 100
library(mvtnorm)
x <- rmvnorm(n, rep(0,k), sigma)

x <- apply(x, 2, cumsum)
matplot(x, type="l", lty=1)

arbitrage - Law of One price and the Inconcistent pricing strategy



Background Information:


A market satisfies the Law of One Price if every two self-financing strategies that replicate the same claim have the same initial value.


An inconsistent pricing strategy is a self-financing strategy $\phi$ with $V_T(\phi)\equiv 0$ and $V_0(\phi) < 0$.


Question:



Prove the Law of One Price holds if and only if there does not exist an inconsistent pricing strategy.



Attempted proof - Suppose we have two self financing strategies $\phi$ and $\psi$ that replicates some claim $X$ such that $V_0(\phi) = V_0(\psi)$. Hence we cannot satisfy the condition of $V_0(\phi) < 0$ nor $V_0(\psi) < 0$ so there is no inconsistent pricing strategy.


I am not sure how to show the converse and whether this is rigorous enough. Any suggestions are greatly appreciated.



Answer




Assume the law of one price. We show that there does not exist an inconsistent pricing strategy. Suppose that $\phi$ is an inconsistent self-financing trading strategy, that is, $V_T(\phi)\equiv 0$ and $V_0(\phi) < 0$. Consider another self-financing trading strategy $\psi$ that does not nothing, that is, without holding any of the underlying assets. Then $V_T(\psi)\equiv 0$ and $V_0(\psi) = 0$. This contradicts the law of one price, since both $\phi$ and $\psi$ replicate the same claim, but the initial prices are different.


On the other hand, assuming that there does not exist an inconsistent pricing strategy, we show that the law of one price holds. Consider any two self-financing trading strategies $\phi_1$ and $\phi_2$ such that $V_T(\phi_1) = V_T(\phi_2)$. Note that $\phi=\phi_1-\phi_2$ is also a self-financing trading strategy, and $V_T(\phi) = V_T(\phi_1) - V_T(\phi_2)\equiv 0$. Since there does not exist an inconsistent pricing strategy, $V_0(\phi) \equiv 0$. That is, $V_0(\phi_1) =V_0(\phi_2)$. Therefore, the law of one price holds.


Friday, February 23, 2018

tools - How do you call "Charte Graphique" in English?


This is not really a translation question - more of a designer vocabulary.


How do you call the set of visuals, logos, designs, colors, fonts... that make a whole design project? In French we would call it "Charte Graphique", and I've seen some translate it to "Graphic Charter" but I think this is just a google translate translation.


Is there a word to describe this?



Answer




I usually use Visual Identity, which in french is Identité visuelle, another word for Charte graphique.


Can the concept of entropy be applied to financial time series?


I am not familiar with the concept of entropy for time series. I am looking for good reference papers and examples of use.



Answer



As a good starting point read this recent paper by Jing Chen:
http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1734526


For a special use of the entropy concept for forecasting the '87-crash read this paper:
http://papers.ssrn.com/sol3/papers.cfm?abstract_id=959547
(Although I tried to contact the authors to get the data to reproduce their findings, which they didn't send, it is still an enlightening read)


For a more popular exposition of the use of entropy in money management (key word 'Kelly formula') you should read this intelligent page turner by Poundstone: Fortunes Formula


EDIT: Quite an interesting paper is this one where Black-Scholes is derived through the use of concepts of relative entropy: http://www.mdpi.com/1099-4300/2/2/70/



Thursday, February 22, 2018

windows os - Should yes/no dialogs also have a cancel?


I remember once reading an article that said whenever you present a messagebox with a Yes/No choice, you should always also provide a Cancel button, even if it does the same as No.


The rationale was that if the users know that Cancel is always the "safe" button to click if they don't understand why the message box was displayed, or are confused by the question.


mockup


download bmml source – Wireframes created with Balsamiq Mockups



I've followed this advice for years (even though I can no longer remember where I originally heard it), but a number of people have complained about it, saying that they would prefer a simple Yes/No.


So now I am wondering whether it is (or ever was) in fact best practice. If a message box presents a Yes/No choice, should it also offer Cancel (in the case where Cancel and No have the same effect)?



Answer



Undo


No, I don't think you should. Instead, you think re-think the whole idea. First of all: do you really, really need a popup dialog with a question like this? Wouldn't an easy to use, reliable Undo option be infinitely better? In that case, you can circumvent the whole Yes/No confirmation, and avoid context switches and generally getting into the users way.


Actions on dialog buttons


And if you really need a dialog box here: instead of putting Yes and No on your buttons in there, why not put the actual action on the buttons? You can do that by rephrasing the text in the dialog (which I hope you phrased so horribly on purpose here), and then name the Yes button "Invert" and the "No" button "Cancel" instead.


In general, I think it is wrong to have two differently named actions in a UI that do the same thing. That leaves users confused as to what are their differences. After all, if there is a Cancel button, it must do something else than No, right? So what exactly is that difference? You know the answer is "none", but does your user?


creative writing - How to describe a diverse set of characters without falling into purple prose or exoticism?


In my setting, a city was founded by people from all over the world, and developed in almost complete isolation (long version here). The story in itself starts several generations after the foundation. All inhabitants of the city have mixed origins, but not enough time has passed for an “average physical appearance” to emerge.


When writing my first test scenes, I found myself describing in too many details the appearance of my characters. For now, my solution is to make the diversity of the city population clear early in the story, and to give only a couple of physical traits to each main character.



But I have the same problems with my crowd descriptions. They end up either full of purple stuff, too dry or just plainly awkward.


For example, I’ve tried describing skin tone with colors only, but it’s not very evocative. I’ve also tried comparisons, using minerals (copper, terra cotta, etc.), plants (wood, flowers, etc.), weather stuff (clouds, sea, etc.) or even food (chocolate, honey, etc.)...
It was the worst.


I just don’t know how to show the variety of skin tone, hair color & curliness, eyes shapes, etc.




What guidelines should I use to convey the image of a diverse crowd and to show the physical appearance of my main characters while avoiding purple prose and awkward comparisons?




EDIT


Quick translation of some of the descriptions I'm not happy with:


The stranger at the kitchen table looked up from her newspaper. She had a thin face splattered with chocolate freckles and flanked by two big round ears.



In the door frame stood a little old man with a closed face and hair like a storm cloud.


When Adda stepped on the deck, she was greeted by a sailor leaning against the parapet, sipping a bowl of coffee almost as dark as his skin.


Her long oiled hair made her look like she was coming back from a swim in the nearest canal. This impression was accentuated by the sweet and sickly smell following her.


He was a man of dignified attitude and slow gestures. His daughters and him shared the same delicate features, the same golden skin, the same brown freckles and the same thick black hair, but not the same ears. The girls had their mother’s ears.


A sentence trying to show the population diversity :


A fever of merchants and buyers filled the market place. Here, one circular look offered the full palette of all the colours, faces and hair métissage * could create.
* (Not sure how to translate it, mixing maybe?)



Answer



There are a number of solutions that I have for this, as I suffered from the same problem:




  • Only describe what you need to


Imagine trying to describe James Bond to someone. You could say that he is handsome, looks good in a suit, and has an athletic build. This could be enough to get a good image in the reader's head, and could describe any of the actors that played James Bond.


Describing someone down to the last detail is generally quite boring for a reader to endure, and they will likely picture something else in their head anyway. It's also very difficult to ingest all of that information and assign it to a single character, so the reader may overlook details of the character that become important later in the story. Rather, just say the important details, those that will help to describe the more unique aspects of a character, and the reader can fill in the rest of the details.


I tend to go for around 3-4 pieces of description that would distinguish a character from John/Jane Everyman. Heavyset, red-haired, tall, muscled, just enough for the reader to distinguish that character from any other that they may read about. If something insignificant like a character's eye-color becomes important later on in the story then mention it as an extra attribute after the description, as it will not be enough to get a good picture of someone on it's own.



  • Introduce characters gradually


It's easy to get details between characters mixed up, especially when they're described close together. Needing to describe what 5 people look like on a page can make a reader easily forget which person is the redhead, who is the person with the large nose and who only wears black clothes.


The best way to do this, particularly if the requirement is that many characters are to be introduced at once, is to stagger the introductions. Have someone approach the character first, have a small interaction to cement that character into the mind of the reader, then introduce another afterwards.



If introducing two people at once, it is best if they are completely different or very similar. This way it is easiest to describe how they are different from each other, again allowing the reader to remember them with minimal extra description needed.


The cliched introduction to a team of people, where one person goes round introducing the newcomer to each member whilst they are performing a specific task, is overused because it works. It immediately cements that Max is the blacksmith, Helen is the archer and Dave is the wizard. This then distinguishes each of them without having to go into too much detail until later in the story when they can be described separately.



  • Descriptions for wider groups


This may help with your issues of having different groups of people that don't fit a single description. Describing a specific trait that is prevalent across an entire group/ family means that it never really needs to be brought up again. After a single clarification, everyone knows that Lannisters have blonde hair, Weasleys have red hair, and elves have pointy ears. That description isn't usually needed again.


You can introduce a group and describe them as having a specific set of characteristics, or describe a single person and specify that a particular feature that they have is prevalent among the group to which they belong: "She had the dark curly hair that was the trademark of her race, however she was much taller than rest of her kin, as they were generally of a much shorter stature."


Whenever someone of that group is then identified, other descriptions of that individual can be used, and the reader will know to assume that they are similar to the rest of that group, rather than having to reiterate that each person of a specific race looks a particular way.



  • POV perspective



If you're writing from the perspective of a character, remember that they would only notice things that they would be likely to notice. So they would not think about or be amazed at things that they are used to, but the reader is not.


This means that, as in your story where every person looks quite different and unique, no one would generally comment on it, as for them it is not out of place. However, they may comment on something that is out of place for them, and explain why it's out of place.


For example, seeing a group of people who look similar and explaining "I've never seen so many people who look so alike before..." would get across to the reader that most people are supposed to look quite different. This means that the need for awkward exposition, such as "everyone looked incredibly different and individual, as expected," is completely bypassed.


What can I do to make my writing less choppy?


Recently and in the past I have been practicing writing as a hobby. I enjoy the creative pleasure it provides, but am hitting major road blocks in the process. My trouble is in seeing the big picture. In college I studied math and physics, and am very good at analyzing, but have enormous difficulties when it comes to creating something. Whenever I write, the material always comes out as a sequence or list. I usually end up listing attributes of a character, events, or details of the setting. I can't seem to tie these things together and make a real story. I feel like every sentence I write is disconnected from the rest. What exercises can I do to improve in this aspect?




usability - Which part(s) of the overall user experience is best represented by the NPS?


I have seen some companies define KPIs for their UX efforts based on metrics like the Net Promoter Score (NPS). However, having worked with many qualitative and quantitative metrics to try and model the overall UX for a product or service, it seems that the NPS is very much a sales and marketing driven metric, and that the part of UX it best represents is probably the utility (i.e. usefulness) of the product/service.


Looking at a simplified description of UX as being the usability, utility and engagement of the user when interacting with the product or service, can it be argued that the NPS is possibility more representative of the utility of the product or service since it is the most likely reason that someone would recommend it to another person.




color - Contrast ratio between foreground and background



What is an acceptable contrast ratio between a foreground and its background?



Answer



If this is for web, I typically use Jonathan Snook's Color Contrast Checker. The safe ratio is about 7.5


Roger Johansson has a nice blog post about varies contrast checking tool, check it out.


fiction - What is considered "childish" in fictional writing?


There are some people who have read some of my book so far and they think it is childish and then some say it's somewhat morbid.


What are your views on what each of those terms means?



Answer



It could be any number of things given that we've seen no excerpt (although sharing one may not be advisable, since advice specific to your case wouldn't help this thread's future users). I'll mention some possibilities; other answers will probably add some more. Some of my examples are things writers find more appropriate when writing for children; others are bad writing people may associate with stories aimed at children, if for these the publication standards are more lax.




  • The vocabulary may be basic.

  • The sentence structure may be repetitive or undemanding.

  • The punctuation may be unsubtle (I've seen stories in children's annuals where just about every sentence ends in an exclamation point, weakening them all).

  • The characterisation may be 1-dimensional, may be riddled with a straightforward allegory (viz. The Chronicles of Narnia), or may tell instead of showing.

  • The dialogue tags may also do this, through synonyms for "said" or modifications of it with adverbs.

  • The repetition in sentences or word choice may grate (see e.g. here).

  • The themes or treatment thereof may be all too innocent.


programming - Finite Difference method in Matlab for SABR volatility model fails to provide correct option values



Currently, I'm trying to implement a Finite Difference (FD) method in Matlab for my thesis (Quantitative Finance). I implemented the FD method for Black-Scholes already and got correct results. However, I want to extend it to work for the SABR volatility model. Although some information on this model can be found on the internet, this mainly regards Hagan's approximate formula for EU options. I am particularly interested in the numerical solution (FD).


I have taken the following steps already:


Substitute the derivatives in the SABR PDE with their finite difference approximations. I used the so-called implicit method (https://en.wikipedia.org/wiki/Finite_difference_method#Implicit_method) for this. Possibility for variable transformation from $F$ to $x$ and $\alpha$ to $y$ is incorporated in PDE discretization, but not applied yet (hence, $\dfrac{\partial x}{\partial F}=\dfrac{\partial y}{\partial \alpha}=1$ and $\dfrac{\partial^2 x}{\partial F^2}=\dfrac{\partial^2 y}{\partial \alpha^2}=0$ in formulas below). Substituting forward difference in time and central differences in space dimensions and rewriting, gives me the following equation: $$ V_{i,j,k} = V_{i-1,j-1,k+1}[-c] + V_{i,j-1,k+1}[-d+e+g] + V_{i+1,j-1,k+1}[c] + V_{i-1,j,k+1}[-a+b+f] + V_{i,j,k+1}[2a+2d+(1-h)] + V_{i+1,j,k+1}[-a-b-f] + V_{i-1,j+1,k+1}[c] + V_{i,j+1,k+1}[-d-e-g] + V_{i+1,j+1,k+1}[-c], (1) $$ where


$a = 0.5\sigma_x^2\dfrac{1}{dx^2}(\dfrac{\partial x}{\partial F})^2d\tau$


$b = 0.5\sigma_x^2\dfrac{1}{2dx}\dfrac{\partial^2 x}{\partial F^2}d\tau$


$c = \rho\sigma_x\sigma_{y}\dfrac{\partial x}{\partial F}\dfrac{\partial y}{\partial \alpha}\dfrac{1}{2dxdy}d\tau$


$d = 0.5\sigma_{y}^2\dfrac{1}{dy^2}(\dfrac{\partial y}{\partial \alpha})^2d\tau$


$e = 0.5\sigma_y^2\dfrac{1}{2dy}\dfrac{\partial^2 y}{\partial \alpha^2}d\tau$


$f = \mu_x\dfrac{\partial x}{\partial F}\dfrac{1}{2dx}d\tau$


$g = \mu_{y}\dfrac{\partial y}{\partial \alpha}\dfrac{1}{2dy}d\tau$



$h = - rdt$


Writing in matrix notation,


$V_{k+1} = A^{-1}( V_{k} - C_{k+1} )$


Note that vector $C$ contains the values that cannot be incorporated via the $A$ matrix, as they depend on boundary grid points.


Edit June 19: Since my other post is focused on the upper boundary in $F$ dimension, lets discuss upper bound in vol direction here, since @Yian_Pap provided an answer below regarding this. Note that I corrected the cross derivative, to be: $\dfrac{\partial^2 V}{\partial F \partial \alpha}=\dfrac{V_{i+1,j+1} - V_{i+1,j-1} - V_{i-1,j+1} + V_{i-1,j-1}}{2\Delta F\Delta \alpha}$, not containing $V_{i,j}$.


Now, as vol bound I set $\dfrac{\partial V}{\partial \alpha}=0$.


Substituting second order accurate backward FD approximation,


$\dfrac{1}{\Delta \alpha}(V_{i,M}-V_{i,M-1})=0$,


since the term in front is not zero, it should hold that,


$V_{i,M}-V_{i,M-1}=0$,



hence,


$V_{i,M}=V_{i,M-1}$ (2),


This can be implemented in the coefficient matrix $A$. Given (1),


$V_{i,j,k} = z_1 V_{i-1,j-1,k+1} + z_2 V_{i,j-1,k+1} + z_3 V_{i+1,j-1,k+1}+ z_4V_{i-1,j,k+1} + z_5V_{i,j,k+1} + z_6V_{i+1,j,k+1}+ z_7V_{i-1,j+1,k+1} + z_8V_{i,j+1,k+1} + z_9V_{i+1,j+1,k+1}$,


Impose the condition (2) as follows:


$V_{i,M,k} = z_1 V_{i-1,M-1,k+1} + z_2 V_{i,M-1,k+1} + z_3 V_{i+1,M-1,k+1}+ (z_4+z_7)V_{i-1,M,k+1} + (z_5+z_8)V_{i,M,k+1} + (z_6+z_9)V_{i+1,M,k+1}$,


Main question: Am I implementing this bound correctly?


Side question: When setting $\nu=0$ and $\beta=1$, $z_7$, $z_8$ and $z_9$ are equal to zero, correct? So, in this case, boundary condition for vol will not affect FD results?


Best,


Pim





Wednesday, February 21, 2018

usability - Show not implemented functionalities to tease the user



I'm working in a startup and we're building a web based application. Not all our features have been implemented yet but we want a way to tell the user that they'll be there one day.


Our current approach is to leave the buttons or links that fire the action and just display a message like "Dear beta user this functionality is not implemented yet."


Is it too confusing for users? What is the best approach to tease them?



Answer



Quite simply don't do this. False expectations are the biggest source of a disappointing experience. It commits you to features that you may not be able/want to produce, users will assume very short timescales for this functionality to be in action, and it also highlights your apps weaknesses leading users to look for these elsewhere with your competitors.


If you absolutely have to add teasers, make sure that it is clear at the beginning of the path that the feature is not implemented. There is nothing more annoying than putting in some effort to start a process only to have the rug pulled out from under you.


fiction - Introducing the hero first?


In the book I'm writing, the first character I introduce dies before the end of the chapter. She is the girlfriend of my hero and is setting up their date before her untimely end.


The hero is also there, preparing in his own way so the chapter itself swaps between the two before the disaster occurs.


When I read it out to the writing group I'm in, one of the others said they didn't like it. Since I'd introduced the female first, he thought she was the hero and found it unsatisfactory that she'd died.



I like it this way because I think it has more of an impact but I'm interested to know. Should I introduce my hero first?



Answer



I would say that it depends on how you want to progress with your story.


Every (good) book, or series of books, that I've ever read sets the tone for the rest of the book in the first few pages. Whether that's with a mysterious murder, the establishment of a prophecy/chosen one or world-building and exposition, the rest of the book will continue with the theme that it begins with. This is so that the reader can tell straight away what type of book they are actually reading.


Therefore if you're planning on having your book being filled with shocks to the reader (having the character that they think is the MC die almost immediately is pretty shocking), having unexpected deaths or even just your hero experiencing many tragedies, then this could be a good start to your story. It would set the tone for what to expect later.


However if you're looking to use it simply as a tactic to engage the reader, then yes it would be wrong. People might initially like your book, but if the writing style that they got interested in the first place changes for the rest of the book, then it's unlikely they will stick it out until the end.


This is not to say that you can't have the exact same events occur if your book is not in this style, just establish them differently. Make it obvious who your protagonist is immediately, preferably by changing the POV character at the beginning of the book. Then the unexpected death could set him off on the Hero's Journey to get justice, meaning that even with the same events, the tone of the book is set differently.




More to the point about your story specifically, every Dan Brown book begins with the main character of the prologue dying almost immediately, so it can definitely be done. However the character is generally given very little background or depth; that usually comes later when their murder is being investigated.


This works well as a shock tactic, as it surprises the reader quickly. However, the reason that your reviewer might have disliked your passage is if the extract was exploitative. If you give the female character a lot of background and are setting her up as the protagonist, only to immediately pull the rug out from under the reader unexpectedly, then you're simply making the reader feel stupid. This is a good way to get people to stop reading.



I feel like it is quite similar to Deus Ex Machina, where the writer just puts something in unexpectedly in order to fix a problem. If you're just putting something in fully unexpected and random, such as (who the reader perceives to be) the main character getting hit by a bus, then what is the point in carrying on reading if anyone can die at any time for no reason whatsoever?


If, however, you put in a short passage about her choosing heels that go with her favorite outfit for the date, but one of the heels is loose, and she offhandedly thinks that she will fix it tomorrow as she is already late, followed later by that same heel breaking and making her fall in front of a bus, then you have knowingly set up a tragic event. The reader will feel that such a horrible occurrence, whilst unexpected and easily avoidable (a staple of tragic tales), was at least given a reason for happening.


world building - Any software that allows me to create documents and maps with links to other documents or photos?


I have to create a small world for my WIP game so I can submit it as my thesis. While I am aware I can use simple text editors (my usual choice) I want to be able to create a tree/web of my ideas, connecting them without having to look through many documents.


A more specific example is


My hero's description > there's a country mentioned there, click it > the country's description > there's an animal mentioned there, click it > see a drawing of said animal.




blog - How do I write a proper cover letter?


I'm an engineer with a fair knowledge of the English language. I can converse with people in English and write as well, but now I'm interested in learning to write cover letters and blogs. I see plenty of books on writing letters in different ways; however, I am still left with the following questions:



  1. In what format can I write a cover letter?

  2. Can I include technical terms in a cover letter?

  3. Are cover letters sent through email differently than written letters?





usability - On mobile phones why is the green (call) button at the left and red (hang) button at the right side?


Some old mobile phones have switched position of green/red buttons.


Currently the green button is at the left and red button is at the right side on mobile phones.


Why? That is rationale? Which standard covers this behavior?


Also look for reference:




Answer



Older mobile phones were expected to be used with one hand at least some of the time, and given that most people are right handed, the right position for the answer button was positioned the best for your right thumb to press it.



In more modern phones, people are expected to hold them in one hand and press the button with another (think smartphones). In this case you'd want to present someone with the default action first, and reading from left to right, that would be the left most button.


page layout - What is the difference between "wrapped" text and "constrained" text?


This question is based on the comments on this answer to another question.


What is the technical difference between text that is "wrapped around" a shape as opposed to text that is "constrained by" a shape?


Is this just 2 different ways to describe the same thing or are they opposing methods to conquer a similar obstacle?



Answer



The difference is really seen in line breaks, capabilities, and edit ability.


Text wraps are self aware. They see the object being wrapped and adjust when that object changes. Increase the dimensions of a wrapped object and the text reflows to work around new dimensions. Most apps also provide a method to adjust the offset of wrapped text. So you can easily control the distance text leaves around the wrapped object.


Text Constrains are dumb. They see nothing but their own container. And, even then, only the outer aspects of their own container. Often this is not an issue if you are constraining text to some odd outer edge. However, you can't constrain text around an entire object. A text constraint doesn't see any "holes" or "counters" in the constraining shape.


A quick example.... Photoshop CS5 constrained text. 12pt Times New Roman. The red line indicates the constrained shape (a shape layer). Note; I had to manually draw the constrain shape around the pill image. There is no automated method to create an odd shape for a text constraint. This, in itself is a HUGE difference compared to a "text wrap".



Text Constraint


Note how, in the bottom image, although the original shape has a counter in it, the text completely ignores that hole and simply flows right over it.


Now a text wrap in Indesign. 12pt Times New Roman. The blue line indicates the text box. And I've set the wrap offset to 0.2pt to mimic Photoshop's constraint distance. Nothing was manually drawn except the rectangular InDesign text frame. There was no need for me to manually adjust for the shape of the pill image anywhere.


Text Wrap


The obvious difference is the complete wrap in the lower image. You simply can't do that with text constraints and a single constrain shape. It would require two shapes and you would not be able to span text across both shapes. Granted, this particular example is an extreme. It's rare you'd want to have text flow from one side of an object to the other. But there are instances where you may want to wrap an odd shape - such as an arm or something thin which would not disrupt the readability if text were to flow on either side of the object. With a constraint you would have to resort to chopping text and copy/pasting sections of text in each constrain shape accordingly.


Now if I overlay the wrap on the constraint.....


Both


You'll see that visually the top image looks pretty similar. For this reason if you need to fake a text wrap via a text constraint, you may be able to use the constraint if you are able to draw a shape which only alters an outside edge. However, should you need to prevent text flowing over an internal item, and occasionally some odd shapes at the edges, the text constrain will fail in many instances.


In addition to all this there's ease of editing. A text wrap can generally be adjusted with 3-5 mouse click or key inputs. A text constraint requires the user to manually move anchors, paths, and handles to change the shape of the constraint.


In the end.. Can you fake a text wrap with text contraints? Yes. Absolutely in some cases.



Are text wraps and text constraints the same? Absolutely not.


Tuesday, February 20, 2018

Risk-Free Rate determinant in CAPM


I have trouble understanding what type of maturity to use when calculating CAPM. My professor uses the 3-Month risk-free rate to backtest a portfolio strategy that uses a lookback period of 1 year daily returns. Another professor uses the 10-year risk-free rate? Shouldn't one use the maturity that corresponds to the holding period as it best describes the opportunity forfeited? Is the risk-free rate chosen out of preference? wouldn't this just under/overstate CAPM?



Answer



I think the best strategy is to follow Ken French who posted all of the Fama-French factors on his website a while ago, including the risk-free rate.


The latter is updated at the same frequency as the portolio returns, e.g. you can't use a 3-month - based rate if you work with monthly equity returns.


icons - Consistent UI experience


Shouldn't a user interface be as consistent as possible?


I believe when a user uses an interface, he experiences certain behavior from the interface, and tries to couple those experiences to the rest of the interface as well.


As an example (and the reason why I posted this question) take the accept answer icons on Programmers.SE.



not accepted image


When looking at these icons, I wonder what the checkmark means. I notice the up and downvote icons are either filled in or not. The filled in icon is filled in since I upvoted. I can't couple this behavior to the checkmark, since it doesn't have an outline. What is the current state of the checkmark?


accepted image


Here I accepted an answer, and notice the checkmark 'lights up'. When comparing to an answer which I didn't accept, I can clearly see the difference that I accepted this answer, and not the other. There is a problem however, when I want to see whether I accepted an answer, and it is the only one there.


So, I believe it would be a big improvement for the accept answer icon to also be outlined. Of course I posted this on Programmers.SE meta as well.




Obviously I agree with the highest upvoted answer, but I was hoping more on a 'scientific' UX answer, perhaps some terminology, or influential articles discussing this topic.


So to rephrase the question: Shouldn't a user interface be as consistent as possible?



Answer



Human-Computer Interaction (HCI) research often refers to transparency as an indication of the clarity and usability of a user interface. Ironically, it's the lack of noticing the user interface which makes it transparent. When it distracts you, as in this question, it is less transparent.



For my thesis, I am looking into Activity Theory which is a psychological theoretical framework which has been applied in recent HCI research. While reading through the book "Acting with Technology: Activity Theory and Interaction Design" by Victor Kaptelinin and Bonnie A. Nardi I came across an interesting section which reminded me of this question I posed a while ago.


In Activity Theory - as the name suggests - activity is placed central in studies which try to understand the way how people act. In this framework, any task, or activity, can be broken down into actions, which are further subdivided into operations.


Activity theory hierarchy. Activity (motive), Action (goal), Operation (conditions)


"Activity theory argues that actions and activities are usually consciously planned, while operations are performed subconsciously and without deliberation." This isn't a fixed hierarchy. Activity Theory focuses a lot on the developmental aspect of the human mind. The process of an action turning into an operation is called automatization. An example of this is when learning to "touch type". At first finding the correct key is considered to be an action, but afterwards it turns into an operation.


So far the background information. The point is, transparency can be accomplished through skill automatization. Or less theoretically put, skill comes with experience, so transparency isn't a fixed property of a system, but dependant on the user and his experience with the system.


Finally to answer the question "Shouldn't a user interface be as consistent as possible?"


Although transparency can't be "built" into the system, designers can facilitate skill automatization, resulting in transparency. One such way to support the user in turning actions into operations is by using consistent affordances. Inconsistencies prevent or slow down the user from doing this, or even turn existing operations back into conscious actions.


publishing - My publisher copyrighted my book cover and interior


My illustrator designed the cover of my book, but my publisher did not want to use his cover. They wanted their illustration department to do it. What I didn't know was that they copyrighted the cover and the interior of the book. Does this mean I can't use that cover or my illustration ever again?





On a US keyboard why is + shifted but - isn't?


I am wondering why standard US keyboards allow you to type - by simply hitting the key, but the + button right next to it needs the Shift key. The default for that key is = and not a minus symbol. + and - are similar operations, which has led me to wonder why they are reversed in their dependence on shift. Is there any reason I am not thinking of which would have lead to this choice?



Answer



Well, you are, obviously, talking about the section of the keyboard whose main function is to write letters for words and sentences, because on the right side of the keyboard, both signs can be used without the shift key.



Going back to your question, the difference is related to the different uses that the dash symbol has on normal writing and the lack of use of the plus sign on the same circumstances.


You can read more about that on the dash page on wikipedia.


Monday, February 19, 2018

legal - Write a book with "protected" characters/ideas without copyright?


I want to write a book about an idea/story I've had for many years that I find many will truly enjoy when furnished out; however, I don't want this to be "open-source"; I don't want anyone to be able to re-use it as their own and profit like it's their work (as a Creative Commons kind of license).


Is there any way I can "protect" ideas/characters without a copyright? Any simpler, easier, freer way?




Should we use ‘narrow and deep’ or ‘broad and shallow’ navigation pattern on mobile devices?


If we have a large content environment on a mobile device, we need some way to access that content with ease. One could implement a narrow and deep navigation pattern which gives the possibility for larger navigation elements to be presented to the user. There will be less errors clicking through content, but there will be more clicks to perform to access the content we’re after.


If we implement the opposite style, where we have a broad and shallow navigation pattern, there will be less click to perform, but there will be harder to find what to click, especially if the navigation elements need to be scrolled through.


‘narrow and deep’ or ‘broad and shallow’ navigation pattern


Image from the book: "Information Architecture for the World Wide Web: Designing Large-Scale Web Sites" by Morville and Rosenfelt


Which of these two patterns would work the best on a mobile device?




Answer



The answer, as always to questions of this nature is the (rather useless) 'It Depends'.


Flat Navigation


The argument could be made that, because it is a mobile site this means that navigation is going to be intrinsicly harder, and therefore a more shallow navigation structure is preferable because that makes it harder for the user to get lost in the site structure - they would only be one or two steps away from wherever they need to go. However, the counter to this is that if you have a flat navigation then that makes the top-level navigation very link-heavy as you need to link to everything from the front-page. A navigation structure that includes numerous pages isn't pratical to display on a mobile screen.


Deep Navigation


The alternative to a shallow navigation is to have a very deep one, deeper than you would get on a 'desktop' site. This way you can have very specific and brief content occupying single pages, so there is less noise when the user reaches the desired content page. Each page would be concise and particularly relevant to the purpose. However the obvious counter to this is that it's going to take much more time to navigate and browse to these pages if you're using the in-site navigation (and not just hitting the page directly from a search result / shared link).


Neither


Just to come at your question in a different way altogether; why assume that you need to make a choice between one or the other? A navigation structure assumes that the user is going to need to navigate around the site. In this day and age, is that really true?


In the same way that the music industry has changed from forcing people to buy a whole album just to listen to the tracks they want to, to a more flexible 'buy the individual tracks you want and nothing else' so too the web is changing. People don't just navigate to content from within the website, they navigate to content by clicking shared links that are suggested on their social-media pages, or from links mentioned in other websites altogether.


When the user is on the page in your site, why require them to have to revert to traditional navigation methods to browse around? That's probably not how they arrived at the site. Why not take a different approach -




  • set up tags against your content so the user can browse to other related pages.

  • Include some 'you may be interested in...' suggestions within your page so they can go off and find other information of note on your site that way.

  • Heck, even suggest pages on other peoples sites instead! Don't pretend that your site is the only place people can get information. Give your site added-value by becoming not just a source of good information, but a source of other sources as well so you can start to become a trusted voice. That's far more valuable than just being 'an easy site to navigate around'.


The web is growing, don't just assume navigation is something that needs to be a choice between two options that have always been around.


business writing - Finding freelance work


My partner is trying to get more freelance web copywriting work and as an avid StackOverflow user I thought I would try to see what the fantastic stackexchange community thinks.


There has to be better ways than trawling through Gumtree ect. only to find ridiculously low-paid posts obviously aimed at the sub-continent. Does a direct approach work, i.e. emailing SEO and web companies asking for work or do these subscription based job sites work? Has anybody succesfuly gotten a good 'gig' from starting out as a SEO copywriter?


I would be interested to hear about anybody's experiences and thoughts and I apologise if this is the wrong forum.



Answer



I've been doing freelance for a bit, and I've found that most of the sites where you have to bid for the work, the wages end up so low that it's not worth taking the project. My biggest suggestion, what's worked best for me, is to create a website. Once you've created a simple, uncluttered website, you can advertise your services on Craigslist or using Google Ads, Facebook Ads, etc. Then clients come to you, instead of the other way around. If your partner has any writing clips, it might be helpful to either list them on the site or build an online portfolio that potential clients can click on. Once they're further along, they can ask for blurbs from clients and put them up on a testimonial page.


Also! Query magazines and other publications regularly with story ideas, or send out letters of introduction to SEO companies, custom publications, small businesses, etc. You can do cold-calling if you want, but I tend not to just because I hate cold-callers.


Freelance writing is 80% marketing and 20% writing, in my experience. You have to keep marketing yourself like crazy, even when you have billable client work.


If your partner needs some more insight, they can look for helpful blogs--there are tons--and check out these two sites (neither of which I am affiliated with, but I read them regularly):


http://www.makealivingwriting.com/



http://www.freelancewritinggigs.com/ (this site posts job opportunities, if she'd prefer to apply for jobs that are already available)


Lots of luck!


creative writing - Swearing - Censor, allude, or include?


I was reading this thread, but it didn't quite the answer a question I had about creative writing and whether profanity should be used or not, in a way that is best for creative storytelling.


Here's what I mean:




James swore under his breath, his hands rummaging through the suitcase - where was the USB drive?



Here, the reader is allowed to imagine what the character might be saying. For the last twenty chapters, you've made your own image of 'James', and you might think he'd say things differently to how someone else might.


Versus:



"Shit!" James cursed, his hands rummaging through the suitcase - where was the USB drive?



Here, I've used the actual curse. Sure, there might be a bit of shock value (and we could scale up the profanity if we need to), but the reader is being told exactly what type of profanity James is using.


I know that books and movies are fundamentally different, but movies having been using the Precision F-Strike for years, to deliver impact just to escape an unfavorable rating. Books don't have ratings, but some might argue about 'target audience'.



For the sake of this argument, let's say that the target audience doesn't mind a bit of swearing (they're not children), but they're not oil-rig workers either.


So, my main questions is: Is it better to use actual swearing, or use 'creative' methods like above?


As a side note, should profanity in conversation be included?



"I've had enough of your bullshit," Andrew snarled, throwing down his badge onto the desk.




Answer



Again not the answer you're looking for, but it depends!


Don't put in swear words for the sake of it, but when they add strength to a piece of dialogue then go ahead.


So when a man kills a man in front of another man is it better for that other man to say "What was that for?" or "What the fuck was that for?" Note the increased impression of anger here? I could have said "What was that for?" John shouted, but the John shouted takes the reader out of the moment. It's a classic Show Don't Tell situation.



As with any media it's easy to fill our writing with swearing, and it's hard to know when to leave it out. In your example; James swore under his breath, you do a great job of expressing the way in which he swore, which is more important in that scene. By this I mean that if you'd said "Shit," James swore under his breath, it would have been unnecessarily clunky and would have damaged the flow of the writing.


The only external force (so not what you think fits the situation best) that you should worry about is your target audience. There are degrees of severity for swear words, and audiences who appreciate different degrees. If you're writing adult fiction (by which I mean Peter F Hamilton, Robin Hobb, China Mieville; not E L James) then any degree that is appropriate to the moment is fine, but if you're writing for kids or even teens you need to consider that degree of swear severity very carefully.


Documentation - do we "Click", "Push", "Press" or "Select" a button on a touch-screen interface


I'm writing some documentation for a web-based application that will run on Android tablets at the factory at which I am employed.


I am having trouble wording the steps where the users must interact with the onscreen buttons via touch.


For example "1. Enter or scan your clock number and then"... "click the button", "press the button"?



Click sounds most natural to me, but it still doesn't "feel" right.


Is the word "click" ubiquitous while explaining interaction with an onscreen button regardless of if there is a mouse involved?



Answer



There's no 'right' answer here. What is more important is that you are consistent within your own documentation.


Regarding touch interfaces, the typical interaction is 'tap'.


Regarding desktops, the typical interaction is 'click'.


In both cases, it's not the ONLY interaction, however, as both touch devices and desktops can be navigated in other ways (such as via the keyboard).


Personally, I prefer a more generic term such as 'select' that can be used agnostically across devices--though some have pointed out that 'select' is often reserved specifically for selecting an option.


Sunday, February 18, 2018

adobe illustrator - Is there a simple way to fill in a grungy font to make it solid?


I'm looking to make the entire letter solid. I want to complete the grungy white space and fill it out with solid black. Is there a simple way to do this?


enter image description here




structure - Should mystery stories have resolutions?



I'm working on the finishing touches of a story that has as part of the plot a possibly-supernatural mystery. I'm feeling rather nervous about the whole thing though because said mystery isn't the focus of the story- the focus the characters who get involved, their relationships with one another, and where their decisions lead them in the story; the mystery is really just a way to explore the characters and their arcs (but is still necessary to the story thematically and plot-wise). Because of that, despite seeing the characters working on solving the mystery, I'm not inclined to actually answer the question of 'whodunit'- it isn't relevant to the larger story or the characters' individual journeys.


I'm afraid that readers will interpret this as a lack of resolution though and end up frustrated with the story, which isn't what I'm going for. What are your thoughts? Should the story end with the mystery solved? Or is it okay to leave it unfinished if the characters' arcs have been resolved?




business - Making web hosting plan payments?


I'm a web designer freelancer. I just started freelancing. What is the best process for web hosting plan payments? Do I sign up for web hosting plan myself using my credit card and collect payments yearly or do I ask the client to sign up for web hosting himself using his credit card? Please let me know what is the best option?




web app - Displaying states of machines – Overview site


We need to display the state of some machines in our web application. The machines can have about 8 different states.


Our idea is to make a site where the user can see all machines and their state. But we don’t really know how to display the individual machines.


A co-worker had the idea of doing something with color codes. Each machine would be displayed as a rectangle in a different color (which indicates its state). Something like this:


Site


I don’t really like this idea because I think the users can’t remember what each color means, respectively it will take a long time until the users know which color stands for which state.


Do you have any ideas how we could display the machines and their state?


The requirements:




  • The site is mainly viewed in desktop browsers. But we also need to support tablets.

  • The users should see the state without clicking or hovering the machines

  • We need to display 20 to 300 machines on the site. (If possible without paging)



Answer



Issues




  • You are right about the use of color. Users are unlikely to remember what it means if you have 8 states. It also creates problems for color blind users.





  • Using a legend is not great because it forces the eye to dart around the screen. It also doesn't solve the color blind issue.




  • 300 items will be difficult to navigate, so careful cell design combined with sorting (e.g. by status, or user-defined) and filtering will help.






Suggestions



Improve your cell design.



  • Every cell seems to be a machine so you may not need to show the machine caption.

  • The number is used to tell the machines apart, so increase the size of the font.

  • Use both color and a label to show the machine status. This is current best practice, because it allows for easy reading by color, but also shows status clearly for color-blind or unfamiliar users.

  • Simplify the cell design to focus the eye on what's important: fade the outline (this will help reduce the grid illusion effect), and avoid making the entire background colored because it makes the numbers harder to read/scan.

  • Use swatches to indicate status, instead of painting the whole background red/green/etc.

  • Add sort and filter controls, as noted above.


A resulting design might look something like this (just the cell layout, you'll have to add filters/sort):



console


This is less dense, easier for the eye to scan, and more communicative of status to a variety of users (new, expert, color-blind, etc).


Hope that helps.


Saturday, February 17, 2018

Is this the correct way to forecast stock price volatility using GARCH


I am attempting to make a forecast of a stock's volatility some time into the future (say 90 days). It seems that GARCH is a traditionally used model for this.


I have implemented this below using Python's arch library. Everything I do is explained in the comments, the only thing that needs to be changed to run the code is to provide your own daily prices, rather than where I retrieve them from my own API.


import utils
import numpy as np

import pandas as pd
import arch
import matplotlib.pyplot as plt

ticker = 'AAPL' # Ticker to retrieve data for
forecast_horizon = 90 # Number of days to forecast

# Retrive prices from IEX API
prices = utils.dw.get(filename=ticker, source='iex', iex_range='5y')
df = prices[['date', 'close']]


df['daily_returns'] = np.log(df['close']).diff() # Daily log returns
df['monthly_std'] = df['daily_returns'].rolling(21).std() # Standard deviation across trading month
df['annual_vol'] = df['monthly_std'] * np.sqrt(252) # Annualize monthly standard devation
df = df.dropna().reset_index(drop=True)

# Convert decimal returns to %
returns = df['daily_returns'] * 100

# Fit GARCH model

am = arch.arch_model(returns[:-forecast_horizon])
res = am.fit(disp='off')

# Calculate fitted variance values from model parameters
# Convert variance to standard deviation (volatility)
# Revert previous multiplication by 100
fitted = 0.1 * np.sqrt(
res.params['omega'] +
res.params['alpha[1]'] *
res.resid**2 +

res.conditional_volatility**2 *
res.params['beta[1]']
)

# Make forecast
# Convert variance to standard deviation (volatility)
# Revert previous multiplication by 100
forecast = 0.1 * np.sqrt(res.forecast(horizon=forecast_horizon).variance.values[-1])

# Store actual, fitted, and forecasted results

vol = pd.DataFrame({
'actual': df['annual_vol'],
'model': np.append(fitted, forecast)
})

# Plot Actual vs Fitted/Forecasted
plt.plot(vol['actual'][:-forecast_horizon], label='Train')
plt.plot(vol['actual'][-forecast_horizon - 1:], label='Test')
plt.plot(vol['model'][:-forecast_horizon], label='Fitted')
plt.plot(vol['model'][-forecast_horizon - 1:], label='Forecast')

plt.legend()
plt.show()

For Apple, this produces the following plot:


enter image description here


Clearly, the fitted values are constantly far lower than the actual values, and this results in the forecast being a huge underestimation, too (This is a poor example given that Apple's volatility was unusually high in this test period, but with all companies I try, the model is always underestimating the fitted values).


Am I doing everything correct, and the GARCH model just isn't very powerful, or modelling volatility is very difficult? Or is there some error I am making?



Answer



I have solved this problem by performing a rolling forecast the following way. I am unsure (1) if this rolling forecast is correct, and (2) how to then perform a rolling forecast 30 days into the future.


import numpy as np

import pandas as pd
import matplotlib.pyplot as plt

from rpy2.robjects.packages import importr
import rpy2.robjects as robjects
from rpy2.robjects import numpy2ri

ticker = 'AAPL'
forecast_horizon = 30


prices = utils.dw.get(filename=ticker, source='iex', iex_range='5y')
df = prices[['date', 'close']]

df['daily_returns'] = np.log(df['close']).diff() # Daily log returns
df['monthly_std'] = df['daily_returns'].rolling(21).std() # Standard deviation across trading month
df['annual_vol'] = df['monthly_std'] * np.sqrt(252) # Convert monthly standard devation to annualized volatility
df = df.dropna().reset_index(drop=True)

# Initialize R GARCH model
rugarch = importr('rugarch')

garch_spec = rugarch.ugarchspec(
mean_model=robjects.r('list(armaOrder = c(0,0))'),
variance_model=robjects.r('list(garchOrder=c(1,1))'),
distribution_model='std'
)

# Used to convert training set to R list for model input
numpy2ri.activate()

# Train R GARCH model on returns as %

garch_fitted = rugarch.ugarchfit(
spec=garch_spec,
data=df['daily_returns'].values * 100,
out_sample=forecast_horizon
)

numpy2ri.deactivate()

# Model's fitted standard deviation values
# Revert previous multiplication by 100

# Convert to annualized volatility
fitted = 0.01 * np.sqrt(252) * np.array(garch_fitted.slots['fit'].rx2('sigma')).flatten()

# Forecast using R GACRH model
garch_forecast = rugarch.ugarchforecast(
garch_fitted,
n_ahead=1,
n_roll=forecast_horizon - 1
)


# Model's forecasted standard deviation values
# Revert previous multiplication by 100
# Convert to annualized volatility
forecast = 0.01 * np.sqrt(252) * np.array(garch_forecast.slots['forecast'].rx2('sigmaFor')).flatten()

volatility = pd.DataFrame({
'actual': df['annual_vol'].values,
'model': np.append(fitted, forecast),
})


plt.plot(volatility['actual'][:-forecast_horizon], label='Train')
plt.plot(volatility['actual'][-forecast_horizon - 1:], label='Test')
plt.plot(volatility['model'][:-forecast_horizon], label='Fitted')
plt.plot(volatility['model'][-forecast_horizon - 1:], label='Forecasted')
plt.legend()
plt.show()

Which produces this plot:


enter image description here


on "recovering probability distributions from option prices" - how to subtract influence of stochastic volatility?


This is based on a 1995 paper by Rubinstein/Jackwerth by the above title where the authors produces a distribution of stock prices inferred from option prices. But their approach only produces a joint distribution of stock prices and whatever other contributing factors, most prominent being volatility.



My question is: is there another way to make out this distribution which also incorporates the expected changes in volatility based on say vix futures? A reference to paper or code will be helpful. Is the difference not sufficient to agonize over? I am interested in computing VaR, that too at time horizons other than the option expiry.


Thanks




adobe photoshop - How do I make this image in image effect?


I am trying to get the following done in photoshop. I have 2 images both on 2 different layers. I have one on top of it and I am using the brush tool to sort of merge it with the bottom layer like shown in the examples but it doesn't seem to work in my case. What are these effects called? I would greatly appreciate any help with this.


enter image description here


enter image description here



Answer



An easier way than masks: using blends.



Here's how I would go about creating the first one:



  1. Grab yourself a picture of a cityscape. Make it greyscale if it isn't already.


enter image description here



  1. Next, grab yourself a picture of a bearded hipster with glasses. Convert to black and white or greyscale and up the brightness and contrast. I've also painted some white over some parts of the background to really only have the face in black.


enter image description here




  1. Put the picture of the bearded hipster on top of the cityscape. Now comes the magic touch: change the layer blend mode to Lighten. This ensures you only keep the light parts of your layer, so the black disappears and the cityscape comes true through there.


enter image description here



  1. Create a new layer with a color fill, or a nice gradient. Change this layer's blend mode to Color or Screen. Or play around with the blend modes until you find one you like.


enter image description here



  1. Enjoy your hipster poster to the max!



enter image description here




Pictures taken from



Friday, February 16, 2018

equities - Price functions based on order book events


Assume some equity traded on a given exchange based on an electronic limit open-order book $B$ that makes sequential updates as a function of time $t$. What are "natural" or common price functions $P: B \rightarrow \mathbb{R}_{\ge0}$?


Two natural price functions are



  1. The average of the best bid and best offer

  2. The price of the most recent transaction


A disadvantage of the first price function is that it doesn't take into account the whole depth of the book. A disadvantage of the second price function is that it only updates when a transaction occurs.


Are there more sophisticated price functions that take into account the whole depth of the book, and change for every update to the order book?



Answer




I recommend reading Cao, Hansch, and Wang (2004) "The Informational Content of an Open Limit Order Book". They present a simple model for an order-book price called the weighted price ($\mbox{WP}$):


$$ \mbox{WP}^{n_1 - n_2} = \frac{\sum_{j=n_1}^{n_2} (Q_j^d P_j^d + Q_j^s P_j^s)}{(Q_j^d + Q_j^s)} $$


Where:



  • $n$ is the order book level

  • $Q_j$ is the size at level $j$

  • $P_j$ is the price at level $j$

  • $d$ is the "demand" side and $s$ is the "supply" side


Stopping Monte Carlo simulation once certain convergence level is reached


I'm creating a Monte Carlo simulation model which I use to price an European option with various pay-off conditions, hence I can't use Black Scholes.



I want to stop the simulation once I am 95% sure I am within 1% of the true value.


To do this, I calculate the relative error (correct naming?) every 10 000 sims using:


$$Relative Error = \frac{(\sigma/\sqrt{n}) Z_{\delta/2}}{\mu} $$


Where $$\sigma/\sqrt{n}$$ represent the standard error and $$Z_{\delta/2}$$ my confidence level, so 1.96 for 95%.


μ is the mean (fair value) of the simulation.


If the relative error is less than let's say 1%, then I stop the simulation.


Is this the correct way of solving my problem?



Answer



Yes, that's an excellent approach. The only time it might go wrong is if, say, you are integrating on some extreme tail event without using importance sampling.


For example, let's say you were simulating expected loss on a portfolio of five bonds issued by the USA, Germany, Norway, Sweden and the Netherlands. After 10,000 simulations, there's a chance you might still not have generated any paths with defaults, in which case $\sigma=0$ and your algorithm would halt.



users - Preferred format to display negative currency (US English)?



Which would be the more readable way to format negative numbers:



  • -$99.99

  • ($99.99)

  • Some other format I haven't considered


Details: Most of our user base has finance experience, but some have none at all. We don't deal with international currencies, and it's a web application so I don't know of anyway to get the user's system settings.



Answer




My wife is a Certified General Accountant, so I asked her about this question.


The standard accounting way is always to show negative numbers in parentheses. If you want to appeal to primarily financial professionals, that's the accepted practice.


She also cautions against using red or drawing attention to a negative number. Highlighting a number necessarily draws attention to it, but negative numbers are a normal part of bookkeeping and financial statements. Unless you have a specific reason for drawing attention to a particular number, it's best not to make it stand out. If you're highlighting a number that is completely normal (even if it is negative), you can actually damage readability and usability. The user has to stop and think, why is this number different or special? At best, highlight situationally and only when it makes sense.


search results - What to do with the "last" button in pagination?


A large number of lists and search result pages use First and Last links, sometimes styled as << and >>. In most cases, the Last button is also the far right one, which seems to be regarded as good usability.


It usually looks like this:


mockup


download bmml source – Wireframes created with Balsamiq Mockups


I personally dislike this arrangement. Why? Because in 90% of all cases, all I need is the Next button. Photo galleries, search results, tables, etc. One case I can think of where I would frequently need the Last button is in internet forums, where I want to jump to the last entry quickly...


The above arrangement makes the Next button both hard to identify and to click because it is sandwiched between those other elements. It appears Next has lower weight than Last.


Sure, logically Last supersedes Next, that's why it's placed after it. But that is at the price of (in my opinion) increased cognitive load.


Can this really be considered as "good usability"?





vector - how to rasterize an SVG without anti-aliasing


I've made a map in inkscape and now need to change it to a bitmap or .png. The map will be interpreted by a computer program which will look for exact colors so the edges need to be crisp. when I export a .png with inkscape, use an online file converter or even take a screenshot it is always anti-aliased. help.enter image description here


enter image description here




Thursday, February 15, 2018

web app - Layout of dismissable event notifications


I'm building an event notification system for a PC browser. The events queue up on screen on top of each other, until you "acknowledge" or "dismiss" them.


The information I need to display is:



  1. Ok Button


  2. Acknowledge Button

  3. Category of event

  4. Time

  5. Event Description


Here's what I have so far:


What I have so far


I'm not really sure how I should layout or present this information within the boxes.


Do you have any suggestions - or are there any precedents I could imitate?


--UPDATE--



Your comments are all MUCH appreciated. A little more context:



  • The notification system will be used by a small number of system admins for a real time business system, and possibly also be displayed on a tv somewhere, like a "system status" sort of thing. They will typically need immediate attention.

  • The categories will be quite fine grained, there will be maybe 20 or 30 of them, so that whole categories can easily be ignored by going to the settings page.

  • "Acknowledge" will turn the message orange and sink it to the bottom (or something like that maybe?). Just so they know someone has seen the message and is working on it. "Ok" will remove the notification.



Answer



Without knowing more about the context, here are a few tips to get you started.



  1. Ok/Acknowledge button. Having both is confusing. What is the difference?


  2. Buttons. Alight to the right. This assumes that the user would want to take in the details before acknowledging the item. Also, it is a commonly used practice.

  3. Category. It depends on what they are. However you could group by category. E.g. All urgent items on top. Alternatively you could display the category after the title. What does the category add to the information given?

  4. Description. This is often good to place on the left. This allows the user to scan through the items more easily. This assumes that the description is the core differentiator. If you placed the category to the left you will have a lot of messages that look the same initially until they read more of the the details. e.g. Instead of starting each with 'Event failure, event failure, event failure' you could have a label before the group of 3 or start with the description then a more subtle suggestion that this is an event failure.

  5. Time If the sequence is important the user might want to scan through the times to see when each happened (or how close etc). Therefore they should be aligned to allow this. Right aligned seems to be a trend. You may have this with less emphasis than the description though.


I've had a go at wireframing one of these options:


Alert list



  • You could save space by having the icon within the alerts and getting rid of the category titles.

  • The checkbox on the right is a guess at the functionality where the user is required to acknowledge the alert.



This example shows a more compact approach. The second part demonstrates a more subtle approach to categories (but beware of what needs attention - see the 2nd item in the list!)


Alerts 2


Photoshop Vectors turned into raster images automatically


Sorry if this has been done before. I just got Creative Cloud, have worked on older versions of Photoshop before. Every time I try to do anything vector based in Ps CC, be it Text, Pen Tool or creating simple Shapes, Ps shows them pixellated and as if they were rasterised whilst showing it as Shape layer, with option to rasterise still selectable. With type, anti-aliasing is on. Am running Illustrator too and there is no problem with my screen representing vector based shapes crisp and clear. When I print text from Ps, it comes out pixellated. When I save it out as e.g. jpg, it is blurry and pixellated. Help please!


Is there something in Ps like the Pixel Preview Setting in Illustrator that I may have switched on accidentally without knowing?





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