Category: R
-
Computing Rank Dependent Utility in R: Getting More out with RDU_Data()
In a previous blog post I discussed how we can compute rank dependent utility in R. Though this function was quite exciting for myself as computing rank dependent utilty by hand is quite labor intensive, I saw the function as limiting in the sense that I was suppressing all the information generated in the process…
-
Computing Rank Dependent Utility in R
Introduction: What is Rank Dependent Utility? Rank dependent utility theory made its debut in John Quiggin’s 1982 paper “A Theory of Anticipated Utility” with the mission, similar to other papers at the time, to come up with a model which addressed the Allais Paradox which was a major problem for expected utility theory. what all…
-
Simple code for the probability weighting function according to prospect theory
Prospect theory made its debut back in 1979 and was one of the first major attempts to address empirical deviations from expected utility theory. One of the key ingredients in operationalizing prospect theory involve conversion of probabilities to “weighted probabilities”. It should be noted that while there are more advanced libraries which are designed to…
-
Coding the Cost Effectiveness Acceptability Curve (CEAC) in R
Introduction The cost effectiveness acceptability curve (CEAC) is a tool used to describe the output of a probabilistic sensitivity analysis conducted on a model used in economic evaluations of health technologies. It communicates the probability of cost effectiveness conditional on our willingness to pay threshold for each unit of effectiveness or QALY gained. while this…
-
Decision Tree Modelling for Cost Effectiveness Analysis in R
Motivation for this blog I have seen several packages and frameworks used for the development of decision analytic models for cost effectiveness analysis in R. Some can be hard to understand and are often paywalled behind some sort of training that is associated with using package. Even after attending some sort of training, some run…
-
Computing dynamic economic models in R for dummies: using deSolve to get qualitative solutions to Euler equations.
Note: A video explaining the content of this blog can be found here The computation of macroeconomic models is one which both fascinates and mystifies new students and scholars in this field. It certainly was a topic which seemed completely inaccessible to me without an advanced knowledge of algorithms and computational expertise. On an outset…
-
Computing A Simple Model of Competitive Equilibrium in R
In the previous posts we have learned how to compute a supply curve and a demand curve. What do we need to do to derive a competitive equilibrium? Before we answer that directly, lets first define what a competitive equilibrium is so to get everyone on the same page. Def: A Competitive Equilibrium CE={x,p} is…
-
Deriving the Supply Curve from the Profit Function in R
In this blog post we will discuss the derivation of a microfounded supply curve in R. Specifically we are interested in seeing how we can compute the supply curve from our firms objective problem. In this case we will consider solving for the supply curve from the following profit function: We note that in this…
-
Deriving the Demand Curve from the Consumer’s Objective Problem in R.
Note: This blog builds off of what was discussed previously here Continuing with our adventures with the NlcOptim package for R we start with trying to use it for deriving useful objects like the demand curve. Since we are economists we’re not going to simply define a downward sloping demand curve, rather we want to…
-
Utility Maximization in R using the “NlcOptim” package
In this blog post we will discuss how its possible to numerically solve utility maximization problems in R using the NlcOptim package. This package is particularly useful because it allows us to solve these problems with as few lines of code as possible. Lets get into it. A Consumer’s utility maximization problem is really just…