statistics

Using exponential distribution to estimate frequency of occurence

Simulating product failures I’m inspired by this post here (http://www.programmingr.com/examples/neat-tricks/sample-r-function/rexp/). And decided to expand on the example. Say you are an owner of a computer store and you would like to estimate the frequency of warranty repairs - and the ensuing costs. Here’s the scenario with the accompanying assumptions Each computer is expected to last an average of 7 years You only sell 1000 computers at the start of each year You sell computer from 2019 to 2025 First, I simulate an exponential distribution of 1000 points for 7 years; and place a time index of 2019 to 2025

Sampling With Replacement Through First Principles

Sampling with replacement Hello! It’s me once again attempting to explain things from first principles - a term popularized by Elon Musk. I will use some psudeo code - on sampling with replacement for weights - to aid my explanation. Earlier in the week, I attempted to write a simple function from scratch but I gave up after realising that it will take me more than 15 mins! Difficulties lies in the multiple switch statements in defining the intervals.