title: “Introduction to the RANSAC Package” author: “Jadson Abreu” date: “2025-05-06” output: rmarkdown::html_vignette vignette: > % % % —

Introduction

This package provides robust fitting methods for linear and nonlinear models using the RANSAC algorithm.

Basic Usage

Linear Example

```r library(RANSAC)

Simulate data

set.seed(123) x <- 1:20 y <- 2*x + rnorm(20) y[c(18,19,20)] <- y[c(18,19,20)] + 30 # Add outliers dados <- data.frame(x = x, y = y)

Fit using ransac_reg

modelo <- ransac_reg(y ~ x, data = dados, n_min = 2, tol = 5)

summary(modelo)

Simulate data

set.seed(456) x <- seq(1, 10, length.out = 20) y <- 2 * x^1.5 + rnorm(20) y[c(18,19,20)] <- y[c(18,19,20)] + 50 dados <- data.frame(x = x, y = y)

Fit using ransac_nls

modelo <- ransac_nls(y ~ a * x^b, data = dados, start = list(a = 1, b = 1.5), n_min = 3, tol = 10)

summary(modelo)

mirror server hosted at Truenetwork, Russian Federation.