/* Describe your code here */ // import from the old Relative Values UI, I didn't write this code -- berekuk //Trying having one file here, to see if that makes editing easier. Will later move this around with some script or similar. ss(t) = SampleSet.fromDist(t) animalModule = { //Sentient Welfare
// MacBook battery capacity batteryCapacity = 65 to 70 // watt-hours // Cost per kWh electricityRate = 0.2 to 0.25 // dollars per kWh, in California // Charging efficiency chargingEfficiency = 0.7 to 0.9 // Calculate cost
wordsPerMinute = 110 to 150 // cost per person // cost per event // cost per person per word // cost per event per word event(numberOfPeople, costPerHour, hours, hoursofPrep) = numberOfPeople * costPerHour * (hours + hoursofPrep)
import "hub:ozziegooen/helpers" as helpers /* Repurposed from this Guesstimate model: https://www.getguesstimate.com/models/187 Different dangerous activities feature different expected chances of dying. It's hard to estimate exactly how bad dying is, but one metric we can use is to instead consider how many hours in expectation risky events will cost you. For instance, something that has a 1/4 chance of killing you, can be
@startOpen @name("Documentation") documentation = " # SquiggleJest Testing Library SquiggleJest is a simple testing library for Squiggle, inspired by Jest for JavaScript. It provides a way to write and run tests for your Squiggle models and functions. ## How to Use 1. Import the library (assuming it's in a file named 'squiggleJest.squiggle'):
import "hub:ozziegooen/sTest" as sTest @hide test = sTest.test @hide expect = sTest.expect @hide describe = sTest.describe @doc( "
import "hub:ozziegooen/sTest" as sTest // This is me messing around with AI-generated Squiggle code. This likely has severe problems! // Cost-Benefit Analysis for a New Factory Construction Project // Helper function to calculate net present value npv(cashFlows, discountRate) = List.reduceWhile( cashFlows, { value: 0, year: 0 }, { |acc, flow|
export examples = [ "ozziegooen/virus-model", "ozziegooen/meeting-cost-calculator", "ozziegooen/laptop-battery-cost", "ozziegooen/wells-riley-model", "ozziegooen/shapley-values", "ozziegooen/AI-safety-company-factors", "ozziegooen/ev-agi-to-individuals", "ozziegooen/costs-of-computer-use", "ozziegooen/costs-of-sfo-to-uk-flight-claude",
/* How long does it take to read different books? How much does that cost, in counterfactual value, assuming that reading time is counterfactually valuable? This is a very simple table of estimates. Inspired by a previous Guesstimate model. */ @hide cost(wpm, valuePerHour, words) = { wordsPerHour = wpm * 120 words * (valuePerHour / wordsPerHour)
/* Describe your code here */ binomialSample(trials, probability) = trials == 0 ? 0 : List( trials, {|| sample(Sym.bernoulli(sample(Dist(probability))))} ) -> sum
@name("Charging efficiency") @doc("Power lost when charging") chargingEfficiency = 0.7 to 0.9 // Calculate cost @hide costToCharge(batteryCapacity, electricityRate, chargingEfficiency) = { loadInkWh = batteryCapacity / 1000 costPerkWh = electricityRate chargeCost = loadInkWh * costPerkWh / chargingEfficiency
/* A replication of this Guesstimate code: https://www.getguesstimate.com/models/10465 This is a model of the expected value, in QALYs, to a random US citizen, due to Transformative AI. I expect that due to TAI, there's some probability (around .01% to 10%) that humans alive today will have a long-term positive outcome, meaning that they are sentient and experiencing welfare until roughly the end of the universe. There's also a chance that there will be an s-risk, and humans now will experience this same time, but
/* Experimental, in-progress model of AI safety compute, over time. */ startYear = 2023 endYear = 2080 yearRange = [startYear, endYear] transformative_ai_timelines(t: yearRange) = { dist = mx(logistic(30, 10), logistic(30, 30), [0.9, 0.4]) -> truncateLeft(0)
/* Simple Shapley Value Calculator Some math from GPT-4 plus this blog post: https://www.aidancooper.co.uk/how-shapley-values-work/ Inspiration from Nuno Sempere's Shapley Value Calculator https://shapleyvalue.com/ Exported Functions:
// InfectedPeople = TotalPeople * chanceOfInfectionPerPerson // KEY FORMULAS ----- export model( infectedPeople, // Q: Does this need to be 1+? Can it be probabilistic? It would be much nicer if we could treat this as a very low number, rather than a small chance of a person. hoursSpentInEnvironment, quantumEmissionRate, lungCapacity, airflow, roomVolume ) = {
import "hub:ozziegooen/movies-2024-July-prediction-tournament" as moviesData /* Describe your code here */ @startClosed @name("Complicated Example Function for Movie Predictions Spec") @spec(moviesData.spec) @location export myForecast = {
@startOpen @name("Documentation: Start Here!") documentation = "This model contains the information necessary to support a forecasting competition to predict the ratings of upcoming movies on IMDB, Metacritic, and Rotten Tomatoes. To participate in the competition, write a function matching this signature: ``` fn( time: Date between 2024-04-01 and 2024-06-01, movieUrl: Metacritic movie ID like \"boy-kills-world\" or \"challengers\", scoreType: One of [\"imdb\", \"metacritic\", \"rottenTomatoes\"]
start = Date.make(2024, 4, 1) end = Date.make(2024, 12, 1) fnPlot(fn) = Plot.distFn(fn, { xScale: Scale.date({ tickFormat: "%B %d" }) }) percentDiffOverTime(time, yearlyDiffDist) = { diff = toYears(time - start) (1 + yearlyDiffDist) ^ diff - 1 }