inst/doc/weatherMRJD-intro.R

## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

## ----setup--------------------------------------------------------------------
library(weatherMRJD)

## ----data-prep----------------------------------------------------------------
set.seed(2026)
n_days <- 100
time_index <- 1:n_days

# Generate baseline seasonal signal with random variation
temperature <- 20 + 8 * sin(2 * pi * time_index / 365) + rnorm(n_days, mean = 0, sd = 1.2)

# Display sample data
head(temperature)

## ----anomaly-calc-------------------------------------------------------------
# Calculate temperature anomaly relative to baseline mean
temp_mean <- mean(temperature)
anomalies <- temperature - temp_mean

summary(anomalies)

## ----model-fit----------------------------------------------------------------
# Fit summary statistics on simulated time series
fit_stats <- list(
  mean = mean(temperature),
  sd = sd(temperature),
  n_obs = length(temperature)
)

print(fit_stats)

Try the weatherMRJD package in your browser

Any scripts or data that you put into this service are public.

weatherMRJD documentation built on Aug. 20, 2026, 5:10 p.m.