Okay, traders, welcome to this week's live analysis session with me, Patrick Mundley. If you can hear me and you can see my screen, the type of why in the chat box just so I know that we're ready to get going. Good stuff. Okay, so before we jump into today's content, first and foremost, we need to adhere to the risk disclaimer. We know that training any financial instrument carries an inherent risk, but more importantly for today's conversation, the views expressed by me today. And the charts look out there. Those are my opinions. They're not indicative of or representative of tick meal UK or tick meal Europe limited. So for those of you for the first time today, brief introduction to myself. My name is Patrick Mundley after I graduated from university I joined a city PLC consulting firm. After a couple of years, learning ropes I left with some colleagues and went on to co found successfully exit a consulting startup, Costa merger in late 2004. And then moved on to explore my passion for markets with some capital to play with and some time on my hands. I saw a day trading or more appropriately day gambling the S&P after some early beginners luck I racked up some solid some solid then quite significant games in my career. As is often the case, my beginners luck run out. And as the market phase changed, I began to basically average down into losing positions, giving back all of my gains and ultimately experiencing a significant six figure hits on my personal capital. Say this was a gut wrenching and sobering experience is an understatement really have to stand back and figure out if it's feasible for me to make a living from the markets. So I decided to get serious about trading and sort out a mentor with an excellent track record in trading, working with my mentor for a period of 18 months to two years it was a time during which I up not just my technical game researching and developing a strategy that suited functionality, extensively back testing and forward testing and developing a rigorous risk management approach, the most importantly during this period of mentorship. I significantly developed my mental game and probably the most important watershed shift I made was from being highly goal oriented financial gains focused individual to becoming purely process oriented. Well it means I had to stop focusing on what I could make from the markets and start focusing solely on managing my mindset to allow me to consistently execute my trading strategy, oftentimes in the face of negative feedback from the market in the form of losing Once you become process oriented and have a professional trading mindset and understand the true nature of training, being a numbers game in which you're simply playing the probabilities. You lose the emotional investment and that hellish emotional emotional roller coaster of living and dying by the outcome of individual trades. I'm no longer concerned with the outcome of individual trades, or even a small string of trades my focus is on the next 100 trades because I know that if I focus on excellence and execution, my trading edge will demonstrate itself over an extended series of outcomes. My multi strategy approach has delivered profitable annual returns since 2008 to 2013. I've also been managing investor capital through my managed account service, delivering annual positive returns and those are the returns you can see on the screen there since 2013. I'm currently responsible for managing a multi-million dollar portfolio. So 2010 I've also personally mentored over 100 private traders of all experience levels from complete novices to former CME floor traders in developing the technical and mental skills to reap consistent returns from the markets. I've consulted to numerous brokers and trading education brands, contributing written content, webinars and live presentation content, or a range of topics from market analysis to trading strategy, development and execution. In addition to my fund management and private mentoring, I'm also a resident market expert for Ticknell, where I provide a daily market outlook and a trade of the day, a chart of the day, a technical pattern that I'm watching in the markets. And you can access these through the Ticknell blog, or you can register your email address to have them sent directly to your inbox. My other, I guess, passion project is as head of trading and trader education for a leading trading education brand called FX CareerSwap, offering development and funding to retail trading talents. We don't just develop retail traders market and trading strategy knowledge. We work on mindset development through our structured program that culminates in managing the firm's capital at zero personal financial risk on a profit share basis. For those that are interested, I have just, you can see on the screen here, we've got the telephone number for the trading desk in London. There's also an email here, which you can send an email through to the guys in London and they'll come back to you with more information about what we offer at FX CareerSwap. Okay, so that said, let's jump into the charts. Actually, first thing, once you just check back in with this S&P chart that we talked about last week, or that we looked at. This trend line that I highlighted did ultimately get tested and we did get a nice bullish reversal from there. And we've seen some follow through and we're consolidating now. So I jump on to the intraday time frame as we can see a bit more clearly where the next opportunity might be. But what I'd be looking for now with respect to these equity indexes is we consolidate and potentially pull back to test the essentially the 50% retracement of these of these moves that we saw off the trend line support. So we have the level on the S&P that I'd be paying attention to is moved back down into the pivot here at 3750s. Watch for bullish reversal patterns there, set long positions, ultimately targeting a move back through the prior highs and up to test trend line resistance towards 3930. At this stage, the bullish view on the S&P would only come into question if we take out this trend line here back towards 3700s. So we have a similar scenario with respect to Dow Jones and so you can see bullish consolidation. So watch for a break and a close above this trend line as an opportunity to do something on the long side in terms of terms of the Dow here so we can expect maybe a little bit more back and filling and then looking for a break. Let me get a retest there of the prior highs at 31300 and then look for an extension higher next target will be up towards 32000s for the Dow Jones there, the DAX, similar story. So we have some back and filling here in terms of the DAX so for this impulsive move so we can anticipate or reasonably expect even that we could see a retest of this trend line or on route to let's just bring in the fibs looking at the tradesman levels. Let's put something into this 13600 area and then watch for bullish reversal patterns there to set long positions targeting a move through the prior highs and certainly looking at 14200 as the next reasonable upside objective. The next story here in the Nikkei 225 let's just see what this trend line so we could anticipate here, maybe we have triangle developing a bullish consolidation pattern. And so we could see a little bit more to the downside here and maybe a test of this third test and then we get the bullish extension in terms of the Nikkei. Let's pay attention to this trend line this comes in at the moment at 27800 which will bullish reversal patterns in around here to look at long positions dollar index. The dollar has been on a bit of a squeeze here higher in terms of recent price action but these two key pivots here. The Nikkei 222 and 908992 had a symmetry swing objective or sorry an equality objective at 9145. We've also got the 91 40 which is the weekly range resistance, and we're seeing a bit of a pullback here now in terms of the dollar. Whilst we are support whilst we find support at the 91 level. I'm still looking for a test or I still be looking for a test of this 91 77 to complete the bigger ABC corrected move before then we can be thinking about potential resumption of the downtrend in terms of the What's what would negate the idea that we test that 90175 area is if we take out this trend line support and a closing basis, then we can anticipate that the correction is complete from this area at the 90145. And then we'd be looking for a retest and a break of the lows at 8923. Gold here back retesting support. We're in a range here at the moment in gold 1875 and 1803. So really what we want to see is we are going to get a close below the 1803 and if we do. And that's going to give us a downside target in gold, which using this, these pivots here would set up a move to the downside in gold down towards projected monthly range support at 1719. And that would be the equality objective coming in there in gold. However, at the moment we just it's really no man's land so not much, not much interesting gold at the moment silver, obviously was pretty, pretty popular scores the end of last week with respect to this reddit retail trading crowds, but traded into weekly and monthly projected range resistance and we saw sharp pullback. Now we've pulled back into the midpoint of the prior range here, just bring in a box. So let's think about this as our range that we have been trading in. You can see that we've, what we've actually done. So this is going back to beginning of this year. So what we've, what we've actually done is we've come straight back into the 50% you can see from the box straight back into the middle. So that's the monthly projected range support now. And we've got the monthly pivots, and we're at the yearly pivot. Now if we can hold here, and actually take out the 27 22 on a closing basis, then there is a chance that we can extend and target a retest of the $30 level and potentially higher than that. So it's a key key test here for silver, and one that you should certainly pay attention to do one I'm paying attention to is for this close back through 27 20 and you very tight in terms of risk reward you just risk risk a dollar here in terms of silver, you'd have a protective stop just below these lows, and then you'd see a prices can extend back up through the $30 level. So keep an eye on silver crude oil. We took, we achieved the $55 target that I was talking about last week, potentially now we can squeeze higher, maybe get up into the 57 57 30 area which is the projected daily range of systems what I'm actually looking for the area that's of interest to me now will be any trade correction back into these prior highs at the 53 80. And we've also got this ascending trend line support in play here. So any bullish reversal patterns from this area would be would be of interest to me in terms of the long side. I'm looking for a test of $60 as the next upside target in terms of crude oil copper consolidating held the quality test at the 349 level. What I'd look for now in terms of copper is a break of this descending trend line. So close through there is an opportunity for then copper to extend and certainly retest the prior resistance up towards 373 also got monthly range resistance coming in there so like him to get a bit sticky up there but certainly close through the pivot here at 359 would give an opportunity on the long side. Bitcoin. I think the, the quality objective, we've seen some erratic trade and we're really just mid range now. So, it's not particularly exciting to me at this, this stage anywhere and I really trade this up the daily charts. So it's not something I'd be trading on the four hour chart. Certainly bullish above 28,000. Well, let's say 28,700. And I'm looking the target I've got the interim target is into the mid 44,000 level. You can see we've got projected weekly range resistance 43,000 monthly up to 4658. So that's where we're at with Bitcoin dollar yen. I'm looking to fade this move in terms of the dollar yen now think we've achieved we've exceeded the quality objective so this is our low here. I'll swing high and my reaction low you can see we've, we've stalled out here and we're starting to lose a bit of momentum. We've got divergence developing here. I think this next extension through the 80 level in terms of the RSI stochastic watching for bearish reversal patterns we've got the yearly pivot at 105 55 we've got projected weekly range resistance 105 70. I'm looking to, I'm looking for any move into this area with bearish reversal patterns to set short positions. And I certainly think we can be looking back into 104 40104 20 as as interim targets in terms of terms of dollar yen. Okay, similar story here with the swissie we've, you can see we've just exceeded the quality objective 90 six we're running into daily range resistance, 90 30 daily R three here at 90 37, and then we've got the monthly range resistance just above at 90 50. So again, I've, I've initiated a position in swissie and I'd like to add to this on any bearish reversal patterns in this area to, to certainly target a retest back down to test the break breakout level here at 89 20 dollar CAD bearish dollar CAD right below this trend line you are you'll remember from last week I talked about how we moved straight into the quality objective and sold off. So whilst we hold below 28128 80 and certainly below this trend line. I'm looking for us to extend lower in terms of the dollar CAD certainly going to move back down into this one 2685 and maybe we'll resume the downtrend in terms of terms of dollar CAD. Looking for the euro versus this swing high now at 120 189 we have an equality objective at 1893. So, whilst we trade today below the daily range resistance. So let's go back to 2046 watch for a test of this 1893 this would be a pivotal test for the euro, see a quality objective, and more often not you'll see corrections terminate at this area and so what we're watching for is bullish reversal patterns here to set, set long positions. We obviously see a little squeeze here in terms of long so it's going to wash down some of the weaker hands, and then maybe we can see the euro uptrend continue. Looking for the euro yen here to get a test into this interim ascending trend line support. We've also got on the daily chart. You can see we've got this trend line from the lows last May so that comes in at 125 60 so anything in the euro yen 125 60 to 126 here would be interesting. We've also got the updated daily range support 125 80 daily S3 125 80 so any move into this area and the bullish reversal pattern. I think there's an opportunity to look to get long the euro yen certainly look for a retest of 127 20. We've also got got clattered with the the BOE interest rates decision where they did when they're they're exploring negative rates but doesn't look like they're going to be doing anything anytime soon so another leg to the downside here in terms of euro sterling. Remember from that weekly chart I'm actually looking for the euro sterling to get a test into the 86 area. We've been watching that very carefully for for a longer term trade in terms of euro sterling but nothing to do immediately. So let's check in with some of these sterling crosses. I posted this is the chart of the day today we traded just shy of the trend line was this is big bullish reversal candle now and look for this euro or sorry sterling on to take out 183 to start more significant move to the upside. This is a sterling big reaction here. I was actually looking earlier to when I was marching this chart looking for a pullback to see if we get a test of this 135 area looks less likely now so as if we can get a big daily reversal here, then I think we get this move up into the 139 and then from there back certainly see 13750 again. So see where we close on the daily candle let's let's pull that up actually just see if we can get a nice outside reversal candle here pinbar. I want to see it close through the pivot here 13682 certainly looking looking bullish now for sterling sterling yen is a trade I've got running. I posted this is a chart of day actually today the sterling Aussie was a chart hit. So I'm long at the moment from from this 143 55 area, and I'm looking certainly for a test of 14450. And then the weekly range resistance 145 of the interim targets I've got for that sterling in long position on running sterling Swiss. Again, I was looking for a test of the trend line we haven't got it we're extending here watch how we trade up into this 123 50 weekly range resistance 123 70 is weekly are three. And I know we've got some momentum divergence here in terms of the site indicators so caution into that area in terms of sterling Swiss sterling Kiwi. So that big inverse head and shoulders pattern that that I referenced we've seen a great reversal there from what could be the right. So this is this being our left shoulder, this double bottom being our head, this being our right shoulder. So I'm going to pay attention to this sterling Kiwi see where we close today. As I might look to add this on the long side. Let's take a look at the daily chart. So you can see it's, you can see it more clearly here. So if we can get nice outside reversal candle take out the 1930 on a closing basis and then look to to go long sterling Kiwi. And we can certainly think about testing the weekly range resistance first at the 192 area, then onto monthly range resistance, 194 50, and then potentially the yearly pivot that comes back in at the prior highs at the moment 9770 would will be reasonable upside objectives so pay attention to the close today on sterling Kiwi. The Aussie looking for the Aussie is in a complex correction here and what I'm looking for was we trade below 7703 is the equality objective weekly range support. Down at 75 and from there I get to be getting bullish again in terms of the Aussie so let's see where let's see how we trade them on if and when we get a test of the 75 level. Equally, if we can take out this 77 pivot to the upside, then I get constructed from those levels as well for higher prices in terms of the Aussie. Ultimately, I'm looking for a test of the 80 handle in terms of in terms of the Aussie Kiwi. A triangle developing here I mean this looks like we could get a breakout potentially. So if we get a close through 77, sorry, 72 30, then I'm going to get, so I'm going to be looking to get long the Kiwi and certainly retest the price at 73 and then we can look up towards monthly range resistance at 73 50 will be the next upside objective but need to get me to take out this 72 30 on a closing basis to suggest that this bullish consolidation pattern is completing and we can resume and move to the upside Kiwi yen area of interest for me here is that's just so yeah what I've been watching for this this Kiwi yen is any move up into this zone here so we've got daily range resistance 76 13 daily R3 76 34 and predicted weekly range resistance at 76 35 watch for bearish reversal patterns there to see a short term exhaustion in terms of the Kiwi yen and potential certainly to pull back into the pivots here pivot cluster down to or 74 90 Kiwi Swiss. This is what I've got running at the moment. What I was looking at is this second so we've got the trend line running here. We are looking to get a close back below it but not at the moment if we take out the monthly range resistance on a closing basis I'll cut my position, but I'm holding it at the moment, got some divergence down here. And we, again, let's see how we trade up the monthly range resistance in daily range resistance just above us so keeping that Kiwi Swiss on the go at the moment Kiwi CAD watch for a potential double top here with weekly range resistance just above 9259. This could, this could be interesting if trade up into here and bearish reversal patterns to set short positions looking for a 19 160 will be the objective there. And that is that's the chart pack for me this week. We're really paying attention to this dollar and and see if we can get see if this is squeezed that we've seen how this position adjustment will see the potential for a pullback at a minimum. We look for a third test of the sending trend line and maybe the potential resumption of the of the downtrend in the dollar. Are there, are there any questions, you can either type in the chat box so you can raise your hand and I can unmute your mic. If there aren't any questions. Charlie the lawsuits with tether haven't, again, I haven't really, I haven't read much about that. My view basically on on these cryptos is that you want if you're going if you're looking to get a position going in them, then Bitcoin is the primary instrument because there is a derivatives market traded in Chicago. And that means the institutional players are involved. There's equally a theory and I believe they're also launching a derivatives market for that next week in Chicago. So we should see a lot more stability in those two than any of the others. But I haven't, I haven't read anything about that, that lawsuit Charlie. Ultimately, I mean any any regulation is generally a negative, but to the degree to which that's implemented. Any other questions, equally if you don't have a question and ending the chat box is helpful so that I know I can, I can wrap things up here. Okay, good stuff. Thanks very much for your time everyone to be sure to also to join us next Wednesday at 3pm for a live debate looking at the impact of the global pandemic second wave and where markets are likely to be heading as we head into into the summer. That's going to be 3pm UK time. And you can, you can sign up via the, via the blog, the ticker blog to join us for that. Otherwise, it will be same time next week. Thanks very much guys have this helps.


Hi, this is your host in Bhartiya and welcome to another brand new episode of TFR Let's see or TFR demo and today we have two guests from cloud Casa by catalogic It's chief operating officer Satya Sankaran and software engineer MD slum Satya MD is great to have you folks on the show Thanks, I'll always a pleasure to speak to you. Thank you. Happy to be here. Satya Of course, we earlier talked when you folks made a switch to Valero Talk a bit about how is this transition working out for not only you folks But also your customers and the users who are leveraging it. It's been a fantastic ride in We went to embrace open source primarily because that's really where every single user of Kubernetes is starting out Right. Everyone's journey is starting with open source technologies first They use Valero and over a period of time Maybe they identify certain things that doesn't just work with Valero and they decide to go to commercial Solutions right but everyone's journey starts with open source even a competitors that knowledge that in that place And but what we saw is and you really look at market adoption You know, you've got Valero with 99% of the market share and everybody else fighting for the one person That is, you know switching over from Valero switching over from open source because well, it doesn't meet all my requirements And I can't wait for Valero to evolve to what I need In a very short time frame. So that's why we really said hey We want to embrace the open source and be where the customers are and the users are and we want to give them a Path to user solution without actually having to switch away from open source because you know It's almost a religious decision for a lot of people, right? You don't want to move from open source to close source if you can avoid it And and and that's not a conversation. We want to be part of it. So we won't keep those guys there So we feel very welcomed by this community. We started contributing very very early on in this decision We now actually answer, you know, more than 90% of the questions that come up in the Valero slack channel or the forums You know, most of the questions are answered by our team. And again, it's because That was what is needed in this ecosystem because the maintainers were a very strong developers But they didn't have a background of you know support and and and in supporting enterprise customers and so on So we took on that role of again kind of just owning that community support In the back end we will also started making, you know, buck fixes and and your back porting important fixes that aren't there in the Loadest version or the version that is most applied So we've started doing that and we're now actually working on some of the core features that are coming up To support cube water or features pretty big. We're working with it at maintainers We're working with the VMware maintainers to make sure, you know, those pieces are In place as well. So in a nutshell, we feel welcomed by the community. We feel like we're contributing to the community and That's that only makes the community stronger and we feel that for the users of Valero You know, we are a low-friction path to enterprise features without actually having to move away from Valero completely running Valero and still getting the features that you as an enterprise user will Will be looking for if I'm not wrong AWS is one of the first cloud providers that you folks Integrated with can you talk a bit about of course, you know, it's a great mix there AWS and cloud Casa The benefits that users see of using cloud Casa with AWS look, I think There are a dozen solutions out there that support Kubernetes for backups today How do you stand out on this ecosystem, right? We're the first ones that really fully integrated with the AWS EKS service And from day one when we supported EKS, we did it in a way that we integrate directly with the EKS engine itself There is so many and so much in Kubernetes that is stored inside Kubernetes But there are a lot of things configurations that are stored at the envelope layer of Kubernetes cluster itself, right? So that information is not sitting inside the cluster it's actually sitting inside the guy that's hosting the cluster and that in this case the most popular Hosting provided in this case is the KS, right? So we integrate directly with the KS to collect information on your node groups your VPC is your your your security group settings and And and MD will walk through some of the load balancer work that we're we did as well We're collecting all of this information In order to make sure that when you bring back your environment, you're not just bringing back the the cluster information that is sitting inside but also the cluster itself Right, so that's one of the benefits that you know users of cloud class I get with the EKS that you don't get to any other solution that is out there in the market second EKS itself is a is is recommending Valero as the best practice for doing backups with their ecosystem EKS is different in the sense that AKS now have AKS backups GKE now have GKE backups whereas AWS simply endorses Valero as the best practice option for for you and and We are the only real solution out there. That's fully compatible with running an upstream version of of of Valero You run the latest version of Valero or the version that works best for you And we simply support, you know management and control of that On top of EKS, right and the third thing an EKS customer should Consider when they are working with us is I talked about how we deliver agentless backups with EKS I talked about how we can spin up a whole cluster With EKS, but what we what a lot of people don't recognize is You can actually back up an on-prem cluster or a cluster that is running in an AKS or GKE and Utilize a recovery workflows to spin it up in EKS in the region of your choice and your account of your choice, right? So as a EKS user you get agentless experience. You get open-source compatibility you get full stack recovery and You get to use EKS as a migration platform as well If you want to move to EKS, you can kind of go from anywhere and we deliver that cluster and cloud mobility for those customers and in and all of those is a very Intentional integration into that is EKS engine because again, it's been the first one We started supporting and it's still going strong. Can you also talk about what does AWS offer for container backup today? Look, AWS has something called AWS backups. It actually supports five or six workloads But EKS is not one of them Kubernetes is not one of them and in in in in this context EKS or AWS is different from the other cloud providers because Azure has AKS backup that just went public preview not too long ago GKE added GKE backup. I think that went Public preview or G. I don't recall but sometime late last year. So now the other two cloud providers offer a bit of backup built into their cloud provider services whereas AWS's Recommendation at this point and the best practice is to simply rely on the open-source Valero to do its backups, right? So AWS doesn't offer an EKS backup per se, but they recommend Valero This is where our strategy of embracing Valero and offering all of the things that AWS user is is is used to Multicluster management You know enterprise reporting and control from a central console Look, if you're gonna put all of your primary workloads and rely on AWS to manage that for you Why do you think people are gonna just do a DIY on backups? Right if primary workloads are going to be something that you rely on AWS to do backups are not something that you're gonna DIY yourself and There cloud cluster becomes an option while it is using the recommended Valero that that AWS recommends that creates a whole bunch of reference architectures in but it gives you that hosted experience a SAS provider offers And that's how we help AWS fill that gap With cloud awesome. Can you also talk a bit about? Why predicting and restoring network and of course load balance or configurations are Important in cloud because mostly cloud is seen as a magical place Because you can't just take a cluster from one place and try to restore the Kubernetes cluster in another place and expect everything to magically work Right people talk about the fact that the platform offers a lot of portability and mobility That just tells you that the binaries will come up and run It doesn't mean all the dependent services that it relies on Are going to work by simply taking a cluster from one cloud provider and try to run it in a different cloud provider, right? and in this is where How you build the envelope around your cluster is very very important. What services are you recommend or are you dependent on your cloud provider to give you? you know almost every AWS user has some level of Network connectivity that is again very proprietary to what AWS offers and there is load balancer that you often will use the default load balancer that is out there That is being offered by the service security groups almost every AWS user uses a concept of IAM Accounts and enable that certain people have certain certain roles and access controls and so on in all of this information Needs to be captured in some way So that when you bring back a cluster you can either map it map this to a different account map this to a different region or potentially even to a different cloud provider, right so It is important that you bring your whole self When you bring up a workload you bring up the whole workload not just the underlying Binary is in the container images in the cluster configuration, but also how is that cluster, you know, what is the cluster dependent on? Can you bring back all of that? During the restore process as well. That's what we make the job easier Otherwise the alternative is you know someone has to manually go and configure everything make sure that these settings match the settings that were taken at the time of backup Which is great on paper. Yeah, a lot of people can do that But oftentimes you don't even know what worked once you've lost the data, right? If you don't have a great recording system, you're not even going to know how it was previously configured If you don't record that information during backup And so we fill all of those gaps so that you don't have to rely on a manual process to get a cluster up and you don't have to You know sit and record and transform when we can do all of that for you automated and essentially deliver recovery is cool MD, that's your turn. Let's do the demo though. So I've logged into my cloud Casa account here and So this is the cloud Casa dashboard So what I'm going to be showing today is I'm going to be doing a backup of an EKS cluster Along with all the associated AWS resources like the VPC subnets The load balancer Satya mentioned And then I'm going to be taking that backup and then I'm going I'm going to be doing a restore from that backup So the first thing that you need to do is to actually Register your AWS account with cloud Casa So to do that you would go to configuration cloud accounts And then you click on add cloud account button on the right side here, and then you can select AWS as the provider type and click next And then you see here you have this launch stack button which will open up the cloud formation stack page on AWS and here you can use our cloud Casa cloud formation stack template to actually Register your AWS account and then you can see here there are specific permissions Specific features that you can enable that corresponds to specific permissions on on AWS rights like EKS, RDS and EBS volume stuff like that But in my case I've already registered this AWS account So I can show you that here As you can see I have one AWS account registered In cloud Casa And once you register your AWS account, it'll be an active state So once you do that you can actually click on the AWS account And then you can see that cloud Casa has discovered All your AWS resources and in this case You can see that I have two EKS clusters that were discovered And so you can see here one is in discovered state one is in an active state So once you register your AWS account of all of the clusters will be in discovered state But to get it into active state you actually need to install our cloud Casa agent And to do that you go to action and install and then you can see here You have a keep control command that you can copy and paste to actually install our agent So the the EKS cluster that I'm going to be backing up today is this EKS cluster here md-test-2 So if I can show you on the AWS console right so over here I have two EKS clusters And this is the cluster that I'm going to Back up here So I'm going to copy that and I'm going to go to my terminal here I'm going to connect to this Cluster here Right it's the cluster here Okay, so you can see here that in the cloud Casa IO namespace I have the cloud Casa agent installed And then you can see so I have a few web applications running here In three different namespaces the web one web two web three. I have some WordPress sites running And I have so if you look at See the persistent volumes Right you can see here that I have six volumes and I have so let's look at the Load balancer setup here. You can see here that I have the AWS load balancer controller running and I have So let's see here Right, so I have a service This service here, which is a load balancer type. So this is my first load balancer here and see if I have any more Right, so I have an ingress running. So that's my second load balancer here And then if I look at my target group bindings Right, so I have you can see here. So this This is the service. This is the ingress And then this is a third load balancer that I have here, which I created manually That I can show you on aws So over here if I go to the load balancer page here You can see that I have three load balancers associated with its eks cluster So two network load balancers one application load balancer And one of these load balancers as you can see is Was provisioned outside the scope of the adb load balancer controller So this one could have been created manually or through something like terraform So what I'm going to do is I want to back up everything right? So I want to back up my eks cluster the configuration the Kubernetes resources the persistent volumes and the load balancers vpcs. So I want to back up all of this information right So to do that from cloud casa what you would need to do is you would go to protection backups Then you can define a backup here And select your cluster Click next and then you can so we have options to select specific resources But I'll leave everything at the default here. You can see here like full cluster. So you can select namespaces select resource types labels Include persistent volumes or this also you can do a snapshot only or you can do a snapshot and copy So you can actually copy the data To cloud casa storage or you can specify your own storage But I'll leave everything here as it is like that and click next So there's hooks pre post a free backup hooks post backup hooks. I'll leave that as it is and click next So there's policy information here You can back up based on a specific schedule that you provide but I'll leave that as it is And then here you can just set up a you can just put a backup name Or you can call it anything like demo one or whatever And then you can click create here So I won't be doing that now because I already have a backup that I ran yesterday So I can show you that so if I got a protection backups And I click on this backup here. You can see I have a backup that ran yesterday Um That is completed and you can see that all my persistent volumes were snapshotted and copied And then if you look at the activity log, okay, so here you can actually see what was backed up So if you look if I scroll down here, you can see that So it backed up all the kubernetes resources, right? So the namespaces The pvcs And then you can see here it backed up the configuration of the eks cluster The node groups the vpc the subnets the security groups And then you can see here that it it did back up that one non-controller provisioned adbs load balancer And then if you scroll down, you can see that it also copied the data as well So yeah, and then the ingress and service and target group bindings as well as you can see So that's for the backup. So once you have that backup You can actually restore From that backup. So if I go to restores, I can click on define restore here Or I can go to recovery points and I can select the latest recovery point over here and click on restore And just like backup you see you can select specific resources or resources to restore like select namespaces or labels or resource types But I'll leave everything as it is and click next Okay, so here you can Select the destination So you can either restore to the existing cluster So the md test to cluster or if you have another cluster registered you can restore to that cluster Or in my case, I want to create a new eks cluster Based on the configurations in the backup, right? So I click on that and then click on eks cluster And then you can select an adbs account which account you want to restore to so in my case only have one account But if you have multiple accounts, you can actually restore to a different adbs account So for here, I'll click next And you can specify name for the eks cluster. So like demo one next The adbs user. So this is the user that will have access to this eks cluster once it's restored So I have that Set that to my user that you can select the region what region you want to restore the eks cluster to And the other field these are all I'll leave it as it is these fields also exist in the eks adbs console. So I'll leave that as it is But all of these informations are pre-filled for you from the backup So it's getting all this information like this, for example, this network information Is coming from the backup. So I can actually have cloud costs that create vpcs and subnets for me From the based on the configuration it got in the backup Or I can Have the option of specifying what vpc and subnets I want to use But I'll leave this as it is and click next Same with the notable configuration. So all of this information comes from the backup Or you can customize it as you want, but I'll leave it as it is and click next Okay, so this is the page that we wanted to come to. So this is the load balancer section So here I can actually So it's asking for the the I am role for the controller the load balancer controller. So I can actually specify What what the I am role here is so I can do that right? So this has permissions to access the The load balancer on AWS Um, and then over here, we can actually modify certain resources the kubernetes resources Uh, so for example, like the service if I want to modify the service, right? So let's say I want to modify that uh, wordpress service that you saw earlier, right? Let's say this wordpress service is the load balancer type But let's say I want to I don't want this as a load balancer, right? I don't want to expose the service I can just set up a cluster ip and save it here or I can modify the ingress for example, right? Let's say this ingress resource here. Um, let's see Let's say I want to change the host, right? So I can change the host here Right now I want to change the host I can do that and I can of course I can also do target group bindings I can update this as well But uh, okay, and uh, so the last thing here is the uh, the non-controller provision load balancer So this is the uh, the non-controller provision load balancer that I mentioned before Right? So this could be created manually or through terraform Um, so this one is coming from the backup. You can choose to have quadcastle restore this for you from the backup Um, so I'll leave that as it is click next And these are the list of add-ons, um I'll leave this as it is so the uh, the uh, the enroll for the ebscsi driver. I'll leave that as it is Uh, so you have the options here. So rename namespaces change storage classes preserve node ports If you want to um, or an overwrite existing resources if there are any Click next post restore hooks. I'll leave that as it is and over here. You can just set a name Right? Uh demo restore, right? And then you would click on restore Here So I already had a restore that I ran yesterday So I can show you that here. So if I got a protection restores and I click on The restore that I had you can see here. I had a successful restore job that ran yesterday Um, and then over here if you look at the pv details, you can see that all the The data of my person volumes in the in the backup was copied over to my new eks cluster And you can see here. So what what did it do in the activity log, right? You can see that It started the restore of the eks cluster. It created the vpcs and some that's from the backup It created the new eks cluster in the in this region the us east one It created the node pool node groups And then it gave access to my user. Uh, and then it You know, it set up the oidc provider. It set up this service account with the EBS CSI driver and then you can see here that you created the the The non non aws load master controller provision load bouncer, right? So the one that was that was created manually So it created that And then it set up the adbs load bouncer controller here as you can see Uh, and then you can see here that it restored all the kubernetes resources including these services and the in the ingress and all that stuff So all of that is now restored. Um, so basically what what just happened is all of the the the configurations of the eks cluster and uh, the kubernetes data the kubernetes resources the personal volume the subnets security groups the The the vpcs the load bouncer as all of that has been restored from the backup Satya md. Thank you so much for of course talking about velaro cloud cosi and thanks for this demo And I would love to chat with you again. Thank you. Awesome. So now and always a pleasure talking to you. Thank you


This study examined the effect of Instagram's popularity on public interest in cosmetic surgery procedures. It found that there was a significant increase in public interest in both surgical and non-surgical aesthetic procedures after Instagram gained popularity in April 2012. This suggests that Instagram may be playing a role in influencing patient decisions regarding cosmetic surgery. This article was authored by Kometh Thawanyarat, Chandler Hinson, Diego A. Gomez, and others.


If a plant has enough water, minerals and energy, it will grow, right? Well, sort of. But there is more to it. Like, why do plants bend towards the light, and not just grow straight? And why is it that the stem grows up, but the roots grow down? It isn't as if the plant has eyes to tell it where the sun is. You should already know about tropisms, so phototropism and geotropism. But if you have forgotten, watch our video called Plant Hormones, Tropisms First. But how does it actually do this? Having been made in the tips of the stems and roots, auxin is moved in solution by diffusion to older parts of the plant. In the stem, the auxin causes the cells to change in elasticity. More elastic cells absorb more water and can grow longer. Strangely though, stems and roots respond differently to higher concentrations of auxin. Whilst the stem cells grow more, the root cells actually grow less. So, auxins make plants grow. But why do they bend towards the light? How do they know to do this when they don't have eyes? The bending happens because the light hits on one side more and breaks down the auxins on that side of the stem. So then, growth slows down on the light side. The faster growth on the dark side causes the shoots and leaves to turn towards the light, which is ideal for the plant for photosynthesis. Auxin is produced in the tips of growing shoots. If the tips are cut off, then no auxin can be produced and so no plant growth. If the tips are covered whilst auxin is still produced, light cannot break it down and so phototropism cannot occur. The plant just grows straight up and does not bend towards the light. Pretty straightforward so far. Now let's switch it up a bit. Auxins have the opposite effect on root cells. In roots, auxins cause less growth. The shaded side of roots contain more auxin and so they grow less. This enables the light side of the roots to grow more and bend away from the light. And if that wasn't weird enough, we have the opposite happening with auxins to gravity too. In a horizontal root, the bottom side contains more auxin and grows less. So the root bends downwards in the direction of gravity. So positive geotropism. But of course, the stem responds differently. In a horizontal stem, again, the bottom side contains more auxins because it is less directly hit by sunlight. But because auxins cause growth in stems, the bottom side grows more, causing the stem to bend upwards, against the direction of gravity. So negative geotropism. But I'm giving auxins too much credit. They don't work alone. They have a partner in crime. Cytokines. You don't need to know anything about these hormones, other than the fact that they work alongside auxins. There is another plant hormone, however, that you do need to be aware of. Gibberellans. Once the seed germinates, the roots and shoots start to grow. But for this, the seed needs energy. Luckily, the seed releases a hormone called gibberellan, which causes the starch in the seed to turn into sugars and provides the seed with energy to grow. As well as causing chute growth, gibberellans can also stimulate flowering and the production of fruit in some plants. And they also work with auxins to cause stem elongation. So now we know all about how plant hormones work. Have a think about how they could be used. We will discover some uses in our video on how we use plant hormones.


But yeah, I guess we can get started. So hello everyone, and welcome to, I guess, this week's edition of the R and Insurance webinar series from the R Consortium. And today we have a, let's say, short introduction into our performance culture, I guess, at least how I think about the code performance in R. Maybe taking some of the, well, introduction part or some background part, as I already mentioned, it is the third part of the R and Insurance or Insurance webinar series, which is called R Performance Culture. Next week we have another piece that is, I think, somewhat related, but looks at a particular component of it with some example. More broadly, I think the first two pieces were delivered by my colleague here, George Spakalukas or George. And George and I work for C3, an actual control, which is part of C3's group risk management. And maybe seeing it here, well, I guess we both work for C3 at the moment, the views that we express here today or the content of this presentation is just for information for you and not any official view of C3 or related entity. With that, yeah, as a brief introduction, just to give you a short, I'm Ben Dijk Schumbeger. I've worked for, well, C3 for a number of years now, eight or so, and recently joined the World Development and Analytics team, which is also, I guess, the slightly infamous Atelier program, where you can also read an interview about online that George is setting. I've been using R since, I guess, my university days where I very much had a sort of statistics and quantitative finance and actual science background. With that, I'd also hand it over to George briefly for a short introduction. Hello, everyone. This is George Spakalukas. I've been in C3 for 15 years now, relatively new to R. Brief introduction at the university, never used it for several years, and then suddenly, my chance came across at six, seven years, and the way it transformed my workflow from Excel to R was something that was very, very, very rewarding experience. And hopefully now, with the sponsorship of Philip Longa or Group C Factory, we're able to share that experience with others internally and with the help of a consortium who we hope to connect with the wider industry and share experience knowledge. Thank you very much, Benedict. Over to you. Yeah, thank you very much. And I think as an additional background, while I guess the two of us have the honor to presenting you today a bit of the content or a bit of, well, some slice of work that we do, I think we're also backed by a very strong R community across the three, so now also called Ateli, communities of people who interact with R coders and the content they produce and so on. Probably several, well, more than a thousand people, definitely, and also we have a few hundreds, 500 or so actual R coders at the three, so there's a strong community there. And the example, some of the background of what we shared today relates to something that is called experience studies. They, I think, is a basic premise of insurance, often as an insurance company, you offer a contract to someone who then becomes a policyholder, and yeah, you don't really know what's going to happen over the next, let's say, year or so, do that policyholder, and how much they're going to utilize that insurance contract or not, though you come in with some assumptions of what's likely going to happen, but year or so later you then essentially take stock of what did actually happen, and clearly not only over a single person, but over what you call a portfolio, so over all the different policies or insurance contracts that you address for a particular, let's say, region, such as the UK or Germany or so, and a particular line of business, I guess, and when you think about something like that, which may include, well, quite bigger data sizes, I think that's also becoming to today's topic, so I think there's a quite famous quote that premature optimization is the root of all evil, and I believe that's also what we see, is what I see often in the context of R, so you have someone transitioning their work maybe from Excel to R, it's most of the time because they're, well, whatever they've been doing, the data sizes or the complexity of the calculation that they want to do, outstrips what Excel can easily do, and therefore what they're looking for is to be very fast, so I think what they're finding is that, oh, Excel can't do it or Excel's very slow, so now I need to find something that's very fast and they look for the thing that is the most performant to do what they do, at the same time, I think the truth is that, at least for typical problems, you probably don't really need to think that much about optimization, there are other considerations that are much more important than that, but what we're talking to do about today's, let's say there's what here called the critical 3%, so what can you do in those few rare cases where you've actually identified a real need to be fast and you would like to use R? And I think that also brings us to one of the common challenges, see, I think R has been designed for flexibility, tries to enable you to do many things, and that flexibility, particularly with the, they evolve on the perspective of metaprogramming, so programming with programming, something that enables many of these, I guess very powerful tools that we have at our hands today, particular things like the tidyverse are only possible because R is quite flexible and you can express what you want to do in various different ways. At the same time, I think, which is just a fundamental effect, if you try to be very flexible, then you're probably not the best at something, so you cannot be the most flexible and the best specialist at the same time. So what you would expect or what the truth is, R is also not that fast, generally speaking, but at the same time, I think it can be fast enough for most of the things that people actually do. So here's a particular example of a relatively well-known benchmark, and as you can see here, many different software or programming languages or packages, libraries that have been compared, and the comparison is what typical database like data manipulation, so you want to group some data by some attributes, or maybe you want to sum over all the values in a particular country, so you had more granular data and you want a less granular aggregation of it. Here you can find that, oh, yeah, there are some frameworks or some libraries like Polar's written in programming, language called Rust, mostly used from Python, and then I guess the famous data table written in C, mostly used from R, but also other things like data frames in Julia or real database system like Clickhouse and also the infamous Spark. And what you can see here, maybe R isn't the fastest option, and this data is also by now slightly old, so clearly depending on what you're doing and how technology involves the exact ranking will move around, but I guess what I take away is that R can probably be fast enough, so why it may not be the fastest option and for a particular problem or a particular point in time, it probably is fast enough for what you actually try to do, and then on top of having this sort of performance on paper, also gives you several different tools to improve the performance of the code you're working on, so starting with the, let's say more documentation or the general tips and tricks component of it to, I think there's a very good e-book from Hadley Wickham, other ones are in particular, that book also has a chapter on performance tuning in R that I've linked in the slides below. So there you can learn some general tips and tricks or some general ideas about how to tune the performance of R in general or how to adopt some patterns or workflows that are generally believed to be faster. That's on top of that, I think there are also many very practical tools if you want to make your R code faster. One of them is the, this relates to code profiling, where essentially you have a script or a piece of code or you have, I guess in most cases, written a function and now you have determined that your function isn't fast enough, so you want to see which parts of that function are very slow. So say your function or this example here is five or so lines of code or only four lines of code and you don't really know which of those is like the expensive one that slows you down. You can use a tool like profvis or code profiling visualization to see which of those lines is actually the ones that you spend your time on. And this mini example here, there's quite clearly a single line, the fitting of the linear model that spends all of your time. So if you want it to be faster, that's probably where you have to look to improve. And assuming that you're trying to, or you've come up with some alternatives and you try to compare them or see like, or as with many things, there are quite a few different ways of achieving your goal and then it becomes about what is the most appropriate for this situation. And assuming that you're driven by the speed or the how fast the code executes and there are tools like the Bench R package or Micro Benchmark R package that they give you very easy tools to just run a line of codes or like run your function and see how it compares to alternative ways of achieving the same goal. And based on that, you can make your choices. But on top of these tools and ways of just thinking about making your code faster, I think it's also quite important to keep other components or other ideas in mind at the same time, in particular, but may happen is that your quicker code is more complex and complexity is hard to measure. There are some sort of quantitative guidelines like cyclomatic complexity, which have been developed mostly in the computer science space that try to measure how complex a piece of code is. But there are also dimensions, as I mentioned, like if in the R universe, tidyverse is very popular and there are millions of people across the globe who know the tidyverse and let's say, the plier, then a piece of codes written with the plier is probably generally thought to be less complex than some other piece of code written in some niche package that only a thousand people in the world know, simply because many more people are familiar with it and the next person reading it has a much better chance of getting it quickly. Similarly, I think that the more straightforward aspects just how many lines of code have you written, if you have a faster piece of code but you need to write twice as many lines, such really worth the cost, so the next person coming in needs to read twice as many lines of code and well, if you have many more opportunities to introduce mistakes, those you just take the next person much longer to get up to speed and maybe they never really fully understand it because they don't have enough time to read all the code. And on top of that, I think there's also next to codes, how well is it documented and how user-friendly it is? I guess that's both on the level of what you're using. So if you're using some existing R package on your code, how well is that documented and how well-known user-friendly is that? And also the code that you produced yourself, you clearly have to make sure that the person using it can also easily feel comfortable with it. If that's going back to our specific case study life, well, I'm going to show you four very short snippets of code just to make that a bit more tangible with many different popular ways of achieving the same or very similar goal in R. They, as I already mentioned, it comes from some case study that we did around having relatively large data sets of a few tens of millions to 100 millions of rows and wanting to do some calculations on top of that. And one basic piece of that is just for an insurance company or re-insurance companies to calculate how much risk are you exposed to? So how many of those policies are active at a particular point in time or which sort of period does it belong to? And, you know, as you can see, it's relatively or it's only a very small snippet of that and also a simplified version of that. So you see there's no error or input checking or error checking or anything like that. So it's just some simple part of the logic. And as you can see here, if you use a Deployer version, it's relatively straightforward. I've also just split it into two mutates because the first one is maybe a bit more complex and if else because you're filtering on some specific rows but the remaining part is very much straightforward. So it should be relatively easy for the next person to understand what you're doing here. So you just have some date and you do some date manipulation. You extract some components out of it or calculate some minimum and maximum with something else. The, I think typically next more complex version that can be fast already is then a DT Plyer version or data.table Plyer version. So for those of you who don't know it yet, there is a nice package called DT Plyer that tries to give you the best of both worlds. It will give you the nice syntax of the Plyer where also allowing you to get some, okay, some of the performance improvements that data.table is typically known for and that I've also shown at the start. And here you can see this version of achieving the same thing. Some things to highlight is you can see at the start I need to introduce additional line of code to set my data to a data table. I also have that lazy DT line of code. So a lazy data table that I need to introduce and I need to be a bit more careful about my mutations or if I want to use newly created column and the next mutate, I have to make sure that I split up those mutates and at the very end I need to add an as data frame but broadly speaking, this is roughly at a very similar complexity while only introducing a little bit of overheads which may already give you quite strong performance increases. Then looking at maybe the next most complex version is real data table code. And again, there are many ways of achieving your goals but here you can see there's a lot more going on. So there are many more brackets. They are mostly empty, sometimes non-empty row field rendering. Then there's the data.table Y argument as you can see, so assigning new values to columns in place. There's definitely a lot of more complexity, a lot of more brackets going on. And as mentioned earlier, if you have an experienced data table user then that may not be more complex than the deployer version but given the relative prevalence, it's probably easier to have the deployer version or the DT-plyer one than this data-available one. Finally, I think the sort of, let's say benchmark that we created for this simple cases then also a version that utilizes RSC API. So C is a separate programming language that is mostly known for its simplicity and speed and that's also what R is based on. And you can also utilize that in your code if you want to. At the same time, as you maybe can already see here, the code becomes quite a bit longer, so it already has redacted quite a few more parts of it and you only see a small piece of the calculation compared to what you did in the previous versions. And here you can see that maybe the R code itself comes very easy because they only call some C function instead. But in the C functions, then there's a lot of overhead. You need to include some header files, or so-called C header files in order to be faster, deal with the so-called open, can deal with the open MP framework which is a parallelization framework and then you have a lot of more complexity and so on going on to achieve the same thing, but it can be much faster. All these options are available to you and you can all do them in R to be very fast. But I think what's for me is the most important takeaway is that R can be very performant and you can, in many cases, also scale it, at least to a reasonable size. So at least I think there are discussions about the sort of petabyte scale of some technologies and I think that's not the sizes that we typically see in insurance context, but what the data sizes we actually encounter can be very performant and scalable. And that can also, you can use it just with one of the easy, tidy-verse tools so you can add a little bit of sophistication with data table or dTiplier to get more speed out of it. And also, I think being performant is relatively well-supported in the R ecosystem so you have many other tools at your disposal like the code profiling visualization tool I mentioned earlier or the micro-benchmark tools to give you some ideas about how to be faster if you really have determined that you need to. But at the same time, yeah, you definitely have to be mindful of the trade-offs that you're making, that sort of speed is not the, most of the time, the sort of loss of your concerns. So only once you know that you're doing the right thing and you also have great confidence that what you're doing is easy enough for the next person who has to look at it to take a look at it and understand it and maintain it. That's when you can think about speed. With that, I think that brings us to the end of the presentation part and I'm happy to take some questions. Ben, can I ask a question until we are waiting for other people to post their questions? Yeah, maybe it makes sense to why people are typing. Can you please comment on the performance of our itself when it comes to discussions around being a single-threaded programming language and what that means in practice and how this can be essentially, the impact of that can be mitigated somehow. Yeah, I think it's a very good question. Our itself is single-threaded. What's called single-threaded essentially can run one line of code of our code one after the other. With, I guess, a multi-threaded example would be able to execute two or more lines of our code independently of one another in parallel so at the same time. I think that which also, broadly speaking, being single-threaded is an effect and it makes programming easier because you know that line 5 gets executed before line 6 and it will always be that way and there's no sort of risk of things getting jumbled up. At the same time, as already mentioned, there are packages or frameworks like data.table that are actually multi-threaded themselves so while you can only run a single line of data.table code, data.table itself is able to paralyze its computations over as many CPU courses you have available so it could be that while on the highest R level itself are maybe single-threaded, you can still utilize the sort of power of your computer on a lower level. Similarly, there are other frameworks like the Parallel Package or Future Package which also use other approaches to try to or to give you some different ways of parallelization with an R while itself is still multi-threaded on the highest level. You can utilize some multi-threading or some more performance underneath. Thank you very much. Maybe going to the questions, first one from an anonymous attendee. Do you have any experience with parallel computing using R and could you share some best practices? I think that very much fits into the question that George just highlighted. I think one of the generally speaking, as I mentioned, I'm personally also a regular data.table user and as mentioned, many of the operations that data.table users are already parallelized in C codes with that OpenMP framework that I've just mentioned. You get the benefit of parallelization while on R itself being in a sequential single thread mode. I think that is probably enough for most people. If you really or if you are outside of the data.table world or related worlds and still want to have some benefit in parallel computing. I think there are again the parallel package or also related packages like the future per R or per R packages that make it very straightforward and I think with respect to best practices that is good question like we have internally sort of developed some best practices and written them down of how we think people at C3 can benefit from multi-threading with the different packages that are available to it. With respect to general best practice, I'd probably say that if you're using something like data.table or a DT player you'll probably benefit from parallel computing quite well. If you need more than that looking into something like the per R package and how it uses parallelization is a quite sensible step and hopefully it's enough to get you started. From Noelle, I noticed your samples didn't have any comments anywhere in the code. Do you believe only code that is self-doc do you believe in only code that is self-documenting when you use comments that play into functionality of some part of the code? I think that's also a very good question and very good observation. Maybe highlighting it I think to a large degree it is also governed by this sort of being a presentation. Sorry I mentioned it's only a small snippet of the code that is only highlighting some of the simpler functionality and I would say if you have something like this snippet shown at the moment with the DT player version I would probably hope that it is self-explanatory enough that there's no additional comments needed beyond that code given that the DT player tries to be very expressive already and that you also follow very reasonable naming rules or the domain that you're in and there's good naming convention for the columns and variables that you're using. Do I believe only code that is self-documenting I think that different scouts of thoughts here I personally like to use comments when I do something that may not be completely obvious or as self-documenting as I said with something like the player or tidyverse we often benefit from very evocative wording like mutates and if-else and other sort of names that hopefully make it quite obvious what you're trying to achieve but I think there's some some of the comments like here and the C code saying that oh yeah I'll give you using openmp that is maybe more opaque and not as immediately obvious to a user most of the time I think comments and code are useful if it's very unexpected behavior or where you do something that seems a bit odd but is necessary due to some let's say do you still supporting some legacy behavior of your codes or there's some very specific configuration that is only important for special cases so I think highlighting those is quite valuable otherwise I'd probably hope that the most of the documentation of the code is done via good naming and good splitting of what you're trying to do and then the part that I find very important is then the actual sort of documentation let's say with R code that is often in the ROX engine framework so you definitely should be or try to spend a lot of effort into documenting your parameters what your function expects and returns and does and also writing some examples so I think that's very important because that's probably what most actual users will look at yeah I hope let's use some answers to that question and I think a question from Archbold could you please summarize the main approaches tools and techniques you use to improve performance of R what runtimes have you observed in practice for or complex models that use R I think with respect to tools and approaches I hopefully mentioned the most important ones here that's I think that's the typical go-to I think there's the education piece hopefully you've had some experience with R or have had the opportunity to read some of the nice material that many of the community produce to have some idea about what the typical approaches that normally yield R or slow code and once you're beyond that I think as mentioned the first goal should be that you have correct code that does what you wanted to do that is sort of solid and I think also going to previous code is a previous question as well documented and maybe commented so that it's very understandable and after that you may look at if you actually realize in practice that the runtime isn't as good as you wanted to be for your use case then you can look at some of the tools like Profis so taking a very a real example that they had so someone had written a function that was doing something in the loop and they essentially the person says okay run this function it takes don't quite know anymore so they ran it overnight so and so many hours and that's too slow for my use case can you take a look so you run Profis over it probably on a smaller sample because you don't want to wait eight hours every time but you cut it down a bit so you can actually try it a reasonable amount of time and then I found a particular part that was very slow and then I did exactly as described here so for the slow parts I tried some alternative approaches of achieving the same again maybe I'm a data.table guy but I found some alternative data.table approach that reduced it from something that took several minutes to single seconds and then after the end the whole runtime went from so and so many hours to a few minutes I think it was eight or something so and I think that's a very potent starting point and how to sort of find those alternative approaches I think they are normally Google or any of these again quite strong open source contributions from people like Adley Wigim are quite important to have some idea about typical issues and faster alternatives I mean the last component about run times complex models I think for me that's probably very difficult question to ask to answer given that just what the model is is very diverged so a model could be a very simple deterministic calculation maybe like what George showed and there you can run your expected monthly installment model for a few hundred thousands of policies in a minute so that's probably good enough there are other models where having like a single real probably not a single but a thousand realizations on a complex Monte Carlo model can already take you minutes to hours and I've seen both so yeah I probably would say there developing code takes time so you would have to come across something that's very slow and used often enough just to make your investment into better code actually useful so if you have something very slow but you only run it once a year probably doesn't matter it's very slow if you have something very slow and you run it twice a day then that may be a worthwhile investment okay we have another question from Jinye hey Benny do you have a view on good use cases of RCPP same question for use of data formats that support partial readings that's also a very good question and I think that there are probably different preferences sort of coming out so maybe mentioned in my introduction I've been using R for a long while in particular I learned out when there wasn't was no tidy worse there was not really developed RCPP and so on so I probably learned how to make do with base R and also the RC API and with that background I probably find alternative approaches like CPP 11 more appealing because they have less of the overheads of something like RCPP so they're closer to only writing C or C++ code but I can understand that depending on your familiarity with the different approaches and where you at that can be quite quite different and RCPP definitely makes it very easy to to port a simple algorithm from from R to some mostly equivalency C++ code I think broadly speaking where I find good use cases for this sort of lower level code is that you have some sequential algorithm so essentially saying that you have a loop and the next iteration and the loop depends on the previous value these can be more difficult to implement in a nicely parallelizing or nicely vectorized way depending on the exact calculation so there may be sense that you just take like the smallest part of this algorithm implemented in RCPP but with RCPP or CPP 11 or just the C API just pick the small part of this algorithm with the loop to do and then you still use the power of R with its for the argument checking the data checking and all the niceness it does for partial reads and parquet I think that's probably an easier sell for me it's quite typical to have relatively typical to have very large CSV files or large databases and then often what you want to do is some aggregation or let's say you want to filter the data to only have it for a few months or for your weeks at a time that's typical use cases where parquet can be quite nice I think next week I'm actually showing a use case that we had for that so I'll just leave the rest of the answer for next week's webinar then we have a question from Michael and considering whether to write more performance codes and moving from to see do you think about implementing this at the start of the analysis only when you or be only when you run into performance issues or see only once you are reaching the production stage that's also a very good question I think from my perspective I probably don't think so I think it's also links nicely into the previous two questions so I think a basic consideration for me is always how often is this code going to be run and how much time is there even to save by having more performance R code so if you have something that takes one minute and you can make it much much faster to one second that's nice but if that is only being run say 100 times total or something so you saved 100 minutes and how much code can you really develop in 100 minutes that's probably not that much you really need to first think about how much time saving is there even possible from running this code before you think about investing a lot of its implementation so I think that probably speaks to the start of your analysis how often do you how much saving could there even be on more performance code realistically and then the other component is I guess from experience identifying kinds of codes that are isn't as good as or maybe slow in performing in regular R dimensions or some sequential loops or so on that they're not easy to paralyze or vectorize you know that you're facing that and you run it very often then maybe even from the start you're thinking about higher performance but I think realistically the main part is really B so you have your written correct code it does what it does it is robust enough and now you find that overall running all of it is too slow for what your expectations and use cases are and that's really when I I guess go into the sort of number three show on the slide here saying okay so where can we pick the specific pieces to make it faster to get within our expectations okay and we have a final question from Ivan which hopefully you pronounce correctly do you utilize object-oriented programming R and your real-world project EGR6 and S4 and does it have an effect on the performance um I guess the easy question, easy answers yes to both so I personally used and seen used both as R6 and S4 and S3 in real life in so 3 in practice and it has some effect of the effect on performance I guess here I'd come back to try to highlight already in the rest of the talk is that it probably has some effect on performance but it didn't really matter in practice so I haven't been utilizing like these so the object-oriented programming frameworks in particular the levels where it matters the performance wasn't really affected so I guess to some degree it's also like my personal preferences I'm more sort of a functional um guy instead of encapsulated object-oriented programming guy so maybe the approaches I choose are already more geared towards functional programming instead of maybe having some agent network that I would try to simulate in a sort of object-oriented style and that is on the other hand maybe I have some higher level structure than S4 let's say but then the actual long-running part of it is let's say some data transformation or something like that and that is then implemented in data.table let's say or dtplier so while there is some performance impact on the choice of using R6, S4 or just regular functions the actual meaningful part of the performance is probably relegated to something lower level anyway it's probably not relevant to the performance discussions at least not what I've seen okay I think that brings us to the end of the questions and I think we also have overrun our slot a little bit so thank you everyone for staying with us for this time and for the questions and interest and hope to see you again next week thank you everyone bye