library(mosaicCalc)
## Loading required package: mosaic
## Registered S3 method overwritten by 'mosaic':
## method from
## fortify.SpatialPolygonsDataFrame ggplot2
##
## The 'mosaic' package masks several functions from core packages in order to add
## additional features. The original behavior of these functions should not be affected by this.
##
## Attaching package: 'mosaic'
## The following objects are masked from 'package:dplyr':
##
## count, do, tally
## The following object is masked from 'package:Matrix':
##
## mean
## The following object is masked from 'package:ggplot2':
##
## stat
## The following objects are masked from 'package:stats':
##
## binom.test, cor, cor.test, cov, fivenum, IQR, median, prop.test,
## quantile, sd, t.test, var
## The following objects are masked from 'package:base':
##
## max, mean, min, prod, range, sample, sum
## Loading required package: mosaicCore
##
## Attaching package: 'mosaicCore'
## The following objects are masked from 'package:dplyr':
##
## count, tally
## The legacy packages maptools, rgdal, and rgeos, underpinning the sp package,
## which was just loaded, will retire in October 2023.
## Please refer to R-spatial evolution reports for details, especially
## https://r-spatial.org/r/2023/05/15/evolution4.html.
## It may be desirable to make the sf package available;
## package maintainers should consider adding sf to Suggests:.
## The sp package is now running under evolution status 2
## (status 2 uses the sf package in place of rgdal)
##
## Attaching package: 'mosaicCalc'
## The following object is masked from 'package:stats':
##
## D
PENDAHULUAN
Mosaic Calculus adalah pendekatan baru dalam kalkulus yang memungkinkan kita untuk menghitung turunan dengan lebih mudah dan efisien daripada kalkulus tradisional. Konsep utama dalam Mosaic Calculus adalah membagi fungsi menjadi potongan kecil atau “mosaik” dan kemudian menghitung turunan pada setiap mosaik.
TEORI DASAR MOSAIC CALCULUS
Mosaic Partisi dan Fungsi
a.Fungsi dapat dibagi menjadi mosaik atau bagian kecil.
b.Partisi fungsi adalah langkah pertama dalam mengoptimalkan dengan Mosaic Calculus.
2.Turunan Mosaic
a.Partisi fungsi adalah langkah pertama dalam mengoptimalkan dengan Mosaic Calculus.
b.Turunan ini kemudian digunakan untuk menghitung perubahan dalam fungsi.
——————————————————————————————-—–—————————————————————————
OPTIMASI NuMERIK DENGAN MOSAIC CALCULUS
Langkah Literatif
a.Optimasi numerik dengan Mosaic Calculus melibatkan langkah-langkah iteratif.
b.Pada setiap iterasi, mosaik diperbarui berdasarkan turunan lokal.
2.Konvergensi
a.Algoritma optimasi berhenti ketika perubahan dalam mosaik menjadi cukup kecil.
b.Ini menunjukkan konvergensi ke minimum lokal atau global.
———————————————————————————————–—————————————————————————-
CONTOH PROGRAM
Setelah membaca materinya sekarang kita akan melihat contoh programnya Berikut adalah contoh program sederhana dalam R untuk mengoptimalkan fungsi menggunakan pendekatan Mosaic Calculus.
# Definisi fungsi untuk optimasi
f <- function(x) {
return((x - 3)^2 + 5)
}
# Gunakan optim() untuk numerical optimization
result <- optim(par = 0, fn = f, method = "BFGS")
# Print Hasil Dari Optimasi
cat("Optimal value of x:", result$par, "\n")
## Optimal value of x: 3
cat("Optimal value of f(x):", result$value, "\n")
## Optimal value of f(x): 5