Squiggle Hub

ai-generated-examples

Updated
//Make a model of the future donations per year within the Effective Altruism community. Do this my making estimates of the number of major donors we'll have in the future, a distribution of how much each might donate per year, etc. 
import "hub:ozziegooen/sTest" as sTest

@doc("Model of EA donation growth over time from 2024-2040")
inputs = {
  @name("Base Year Donors (2024)")
  @doc(
    "Estimated number of significant EA donors in 2024, defined as those giving >$10k/year"
  )
  baseDonors2024 = {
Updated
import "hub:ozziegooen/sTest" as sTest

// Global AI Damages Model (2024-2030)
@doc("Detailed model of potential AI harm categories and their damages.")
@name("AI Harm Categories")
damages = {
  // Near-term damages (2024-2026)
  @name("Misinformation & Fraud")
  @doc(
    "Damages from AI-generated scams, deep fakes, and misinformation campaigns. High uncertainty due to:
Updated
//Cost-effectiveness of our 10-person nonprofit signing up for Slack Pro. Our organization uses Slack heavily. This provides us with: - Unlimited message history - Unlimited apps and integrations - Unlimited canvases with 30 days of version history - Voice-first huddles with up to 50 participants - Secure work with other companies using - Slack Connect channels We expect that the main factor is the message history. Take into account a bunch of factors. The cost is $7.25 USD/person/month 

import "hub:ozziegooen/sTest" as sTest

@name("Slack Pro ROI Model")
@doc(
  "Base model for Slack Pro cost-effectiveness analysis. Main benefit expected from message history access."
)
inputs = {
  @name("๐Ÿ‘ฅ Number of employees")
Updated
// Cost-effectiveness of our 10-person nonprofit signing up for Slack Pro. Our organization uses Slack heavily. This provides us with: - Unlimited message history - Unlimited apps and integrations - Unlimited canvases with 30 days of version history - Voice-first huddles with up to 50 participants - Secure work with other companies using - Slack Connect channels We expect that the main factor is the message history. Take into account a bunch of factors. The cost is $7.25 USD/person/month

import "hub:ozziegooen/sTest" as sTest

// Core model inputs
@name("Organization Parameters")
inputs = {
  @name("Number of employees")
  teamSize = 10
Updated
//If I get dark blinds for my room, it might help me sleep a bit better. Estimate the total hours I might save per year, of productivity, due to this change.

import "hub:ozziegooen/sTest" as sTest

// ==== Inputs ====
// Basic material and labor costs, highly variable by region and quality
@name("๐Ÿ’ฐ Material Cost ($)")
@format("$,.0f")
@doc(
  "Base material cost assumes standard blackout blinds. Could vary significantly based on quality, size, and features."
Updated
import "hub:ozziegooen/sTest" as sTest

// Model to estimate value of 1 hour socializing with a friend
@hide
@name("Model Parameters")
modelParams = {
  @name("Your Age (years)")
  @doc(
    "Age impacts both health and networking benefits. Higher ages typically mean more health benefits but fewer networking opportunities."
  )
Updated
// Create a cost-benefit analysis for a new bubble tea store in Berkeley. Model over 5 years. Include: - Setup and monthly operating costs - Revenue streams - Market factors and risks (including failure probability) Outputs: - Key costs and benefits table - Cumulative failure probability - Charts: monthly costs, benefits, net value over time

import "hub:ozziegooen/sTest" as sTest

// Bubble Tea Shop Cost-Benefit Analysis Model

@name("Initial Costs")
@doc(
  "One-time setup costs for opening the shop. Note that costs could vary significantly based on location within Berkeley, property condition, and market conditions. Renovation costs particularly uncertain due to potential building code requirements."
)
Updated
// If I get dark blinds for my room, it might help me sleep a bit better. Estimate the total hours I might save per year, of productivity, due to this change.

import "hub:ozziegooen/sTest" as sTest

@name("Blinds Impact Model")
inputs = {
  @name("Hours of sleep improvement per night (minutes)")
  @doc(
    "How many extra minutes of quality sleep we'd get from better darkness. High uncertainty - could be minimal for people with good existing curtains, or significant for light-sensitive individuals."
  )
Updated
// Estimate the expected value of using cost-effectiveness analysis for the operations of a small 3-person nonprofit. Break it down into 20 different areas where such work can be useful, with estimates for each.

/*
Cost-effectiveness Analysis Model for Small Nonprofit Operations

This model evaluates the potential ROI of conducting cost-effectiveness analysis 
across 20 different operational areas for a small 3-person nonprofit. 

Key Assumptions:
- Staff hourly rate: $30-60/hour reflects typical nonprofit rates
Updated
import "hub:ozziegooen/sTest" as sTest

/*
Model: Window Opening Cost-Benefit Analysis for Seminar Room
Purpose: Analyze tradeoff between disease transmission risk and noise impact
Key Results: 
- Opening windows provides net positive benefit in most scenarios
- Disease risk reduction (30-70%) outweighs learning disruption
- Surprisingly robust to uncertainty in parameters
- Most sensitive to QALY valuations and productivity impact assumptions
Updated
// We have 25 people in a seminar. We can open the window - this would reduce the chance of disease transmission, but it would increase the loudness by 5-10db. Do a an analysis to estimate if we should keep the window open. 

import "hub:ozziegooen/sTest" as sTest

// Analysis of window opening tradeoff in a 25-person seminar: disease transmission vs noise
// Using distributions to model uncertainty and calculate expected value

@name("๐Ÿšถ People in seminar")
peopleCount = 25
Updated
//Suggest 10 strategies to cut down on beliefs of conspiracy theories in the US. Make some simple models to order them on cost-effectiveness.

import "hub:ozziegooen/sTest" as sTest

// Model to evaluate cost-effectiveness of strategies to reduce conspiracy theory beliefs
// Each strategy has implementation costs and estimated effectiveness in reducing beliefs

@name("Strategy Implementation Costs ($)")
@doc("Estimated costs for implementing each strategy at a national level")
implementationCosts = {
Updated
import "hub:ozziegooen/sTest" as sTest

/*
MODEL OVERVIEW:
This model evaluates 20 unconventional organizational improvements, estimating their costs, benefits, and net value. 
Each initiative has an uncertain cost range and a productivity/wellbeing multiplier.

KEY FINDINGS:
1. Only 4 initiatives showed reliably positive expected value:
   - AI Transcription (55% chance of positive ROI)
Updated
//Come up with 20 unusual improvements for an organization, and estimate the expected costs / benefits / nets for both. 

import "hub:ozziegooen/sTest" as sTest

// Model to evaluate unusual organizational improvements with costs, benefits, and net values
// Uses mixture distributions to account for uncertainty in novel interventions

@doc("20 unusual organizational improvement ideas with cost-benefit analysis")
improvements = [
  {
Updated
// Create a cost-benefit analysis of hosting a Progress Studies conference with 300 people who are generically interested in the field. 

// Cost-benefit analysis for hosting a Progress Studies conference
// Models direct costs, attendance revenue, and estimated impact value

import "hub:ozziegooen/sTest" as sTest

@name("๐ŸŽŸ๏ธ Attendee Count")
@doc("Expected number of attendees, based on similar conferences")
attendeeCount = 300
Updated
// Cost-benefit analysis model for a new bubble tea store in Berkeley
// Models costs, revenues, and risks over 5 years with monthly granularity

import "hub:ozziegooen/sTest" as sTest

// Setup costs
@name("๐Ÿ’ฐ Initial Setup Costs ($)")
setupCosts = {
  renovation: 50k to 100k,
  equipment: 30k to 50k,
Updated
//Write 2 functions. They both take in 2 variables: Year (2024 to 2030) and the US unemployment that year. The first function outputs the US inflation at that year. The second function outputs GDP growth in that year.
// This code defines functions for estimating US inflation and GDP growth, and includes a calculator to output these estimates based on user inputs for year and unemployment rate.

import "hub:ozziegooen/sTest" as sTest

@doc(
  "Calculates estimated US inflation rate based on year and unemployment rate"
)
inflation(year: [2024, 2030], unemployment: [0, 100]) = {
  baseInflation = 2
Updated
// This model estimates the number of real monthly active users across all blockchains
// by creating a table of the top 10 blockchains and their estimated user bases

import "hub:ozziegooen/sTest" as sTest

@name("Top 10 Blockchains and Other")
@doc("Estimated user bases and real user percentages for major blockchains")
blockchains = [
  { name: "Bitcoin", users: 2M to 6M, real_percentage: 85% to 95% },
  { name: "Ethereum", users: 1.5M to 4M, real_percentage: 75% to 90% },
Updated
/*
This calculator estimates how many ice cream scoops it would take to scoop out the entire moon.
The model considers different scoop sizes and accounts for uncertainties in measurements.

Results:
- For a medium-sized scoop, it would take approximately 2.3e25 scoops to empty the moon.
- This number is surprisingly large, highlighting the vast difference in scale between everyday objects and celestial bodies.
- The calculation demonstrates the importance of using distributions to account for uncertainties in both scoop and moon volumes.
*/
Updated
import "hub:ozziegooen/sTest" as sTest
// This code models and projects the percentages of different AI chip market segments in 2030.
// It includes estimates for data center inference, optical accelerators, and memristor-based in-memory computing.
// The code creates a calculator with key inputs and displays function plots from now until 2030.

@doc("Calculates market share percentage over time")
marketShareProjection(initialShare, growthRate, maxShare, year) = {
  share = initialShare * (1 + growthRate) ^ (year - 2023)
  min([share, maxShare])
}